Commit graph

4712 commits

Author SHA1 Message Date
cinap_lenrek a291bbdedd libsec: ecdsa client support for tlshand, cleanups 2016-02-01 21:34:49 +01:00
cinap_lenrek 0bfac109a4 mpc: constant expression folding 2016-02-01 19:27:57 +01:00
cinap_lenrek 340d83d49d games/doom: fix white window issue on exit
make kbdproc() and mouseproc() share fd table with the main proc
and not explicitely close the file descriptors. so /dev/mouse gets
closed *after* /dev/draw/new to avoid the white window refresh issue.
2016-01-30 19:11:33 +01:00
cinap_lenrek 7cfe4aef3c salsa(2): fix source reference 2016-01-19 13:06:22 +01:00
cinap_lenrek 876e19c652 salsa(2): some formating fixes 2016-01-19 13:02:12 +01:00
cinap_lenrek 7cf11db685 libsec: add salsa20 stream cipher 2016-01-19 12:50:33 +01:00
cinap_lenrek 7b31d5e494 authsrv(6): fix arrows 2016-01-19 11:08:29 +01:00
cinap_lenrek 4a47b264ac wifi: check tkip/ccmp mac and crc in constant time avoiding timing side channels 2016-01-14 23:39:29 +01:00
cinap_lenrek a57a6e511f pc64: move idle() routine after CALL main(SB) as the comment suggests 2016-01-14 01:08:36 +01:00
cinap_lenrek ed4c812765 pc/pc64: backing out new mp startup code (caused issues with ramnode)
apparently, this causes some quadcore ramnode vm to hang on boot,
even tho all cores successfully started up and are operational.

i suspect some side effect from timersinit()... this would also
mean *notsc= would break it (syncclock() would continue)...
its unclear.

i'm reverting this for now until the problem is better understood.
2016-01-13 23:18:25 +01:00
cinap_lenrek 21b70c782a devssl: use tsmemcmp() to compare mac to close timing side channel 2016-01-13 21:48:09 +01:00
cinap_lenrek 5243969ba2 ndb/dnstcp: -x specifies the mountmoint 2016-01-12 08:53:06 +01:00
cinap_lenrek 36d2092a33 fix manpage references 2016-01-12 08:43:36 +01:00
mischief af42c4f481 libauthsrv: fix ed448 goldilocks prime comment 2016-01-11 19:30:41 -08:00
cinap_lenrek 63f9a4fda3 pc/pc64: bring up ap's one after another, use idlehands() while waiting for thunderbirdsarego
when testing in qemu, launching each ap became slower and slower
because all the ap's where spinning in syncclock() waiting for
cpu0 to update its mach0->tscticks, which happens only much later
after all cpu's have been started up.

now we wait for each cpu to do its timer callibration and
manually update our tscticks while we wait and each cpu will
not spin but halt while waiting for active.thunderbirdsarego.
this reduces the system load and noise for timer callibration
and makes the mp startup linear with regard to the number of
cores.
2016-01-11 06:47:52 +01:00
aiju dacaf31eb0 libauthsrv: add D in mkfile 2016-01-10 22:03:27 +01:00
cinap_lenrek ad87473109 pc/pc64: remove mpshutdown print 2016-01-07 19:37:47 +01:00
cinap_lenrek 5afa5f5c0b kernel: remove todfix overflow iprint() spam 2016-01-07 19:37:05 +01:00
cinap_lenrek 6a651b42ac ape/stdio: %z format is VLONG on amd64 2016-01-07 19:20:30 +01:00
cinap_lenrek 4308f6e7e6 ape/fmt: %p and %z format for amd64 2016-01-07 19:04:12 +01:00
cinap_lenrek 772afbe98c format pointer subtraction results with %zd instead of %ld (for long -> intptr on amd64) 2016-01-07 04:44:13 +01:00
cinap_lenrek 9c99d0c8d3 6c: return vlong result for pointer subtraction 2016-01-07 04:40:47 +01:00
cinap_lenrek 3e38194d72 introduce signed intptr and %z format modifier for formating uintptr and intptr 2016-01-07 04:39:09 +01:00
cinap_lenrek 59245c73f0 venti/fixarenas: more %z -> %Z 2016-01-07 03:38:07 +01:00
cinap_lenrek 9a337f8dfc venti/fixarenas: replace %z fmt with %Z 2016-01-07 02:27:00 +01:00
cinap_lenrek 094f0c9601 rx: theres no p9sk2 anymore 2016-01-06 06:00:22 +01:00
cinap_lenrek dc96f164a2 merge 2016-01-06 05:31:55 +01:00
cinap_lenrek 5e24adafef libsec: make sure theres no garbage after the asn.1 decode, cleanup 2016-01-06 05:30:44 +01:00
cinap_lenrek cd74719101 merge 2016-01-06 03:59:40 +01:00
cinap_lenrek 4cf801b853 add missing /sys/src/cmd/auth/lib/private.c 2016-01-06 03:58:04 +01:00
stanley lieber 3735cc9bc3 authsrv(6): english 2016-01-05 21:34:15 -05:00
cinap_lenrek 2dae1ed53a auth: release dp9ik implementation and reentrant factotum 2016-01-06 03:09:00 +01:00
cinap_lenrek e064752dd4 libmp: silence compiler warning for strtomp 2016-01-06 01:19:05 +01:00
cinap_lenrek 32c11e2871 pc/pc64: import i210 support from erik quanstrom's 9atom 2016-01-05 07:53:39 +01:00
cinap_lenrek 41383ad012 kernel: change active.machs from bitmap to char array to support up to 64 cpus on pc64 2016-01-05 05:32:40 +01:00
cinap_lenrek dd8908cff0 fdisk: properly convert byte units K,M,G and T to cylinders/sectors
the shared command language assumed 512 byte sectors, which is
not the case for fdisk as it uses cylinders for the block unit.
so we introduce an extra argument in the Edit structure and
parseexpr() function so byte sizes are properly converted to
the block unit when the K,M,G and T postfixes are used.
2016-01-05 03:57:50 +01:00
cinap_lenrek 5aeddd6788 libmp: check nil return value of strtomp() in test program 2016-01-04 19:09:25 +01:00
cinap_lenrek 263b0e34b2 mpc: use new strtomp() c-style prefixes to parse integer constants 2016-01-04 18:35:04 +01:00
cinap_lenrek f5fcf6688b libmp: mistake in strtomp() 2016-01-04 18:33:06 +01:00
cinap_lenrek d30b160fe3 libmp: support for c-style base prefixes for strtomp(), octal support 2016-01-03 22:43:44 +01:00
cinap_lenrek 39f18c9d88 libsec: implement TLS-PSK for tlsClient()/tlsServer() 2015-12-25 17:05:05 +01:00
cinap_lenrek 4a6ab355c1 file: recognize bootable disk images (by 0x55AA boot sector signature) 2015-12-23 02:31:47 +01:00
cinap_lenrek 76e5cda11a file: recognize tcpdump pcap files 2015-12-23 02:11:29 +01:00
cinap_lenrek 46bbeea040 snoopy: fix timestamps for pcap files (thanks BurnZeZ)
the pcap files produced by snoopy had the wrong timestamps because it expected:

/* magic=0xa1b2c3d4 */
ulong ts_sec;	/* seconds*/
ulong ts_usec;	/* microseconds */

but we wrote:

uvlong ts;		/* nanoseconds */

now, we write:

/* magic=0xa1b23c4d */
ulong ts_sec;	/* seconds */
ulong ts_nsec;	/* nanoseconds */
2015-12-23 02:00:09 +01:00
cinap_lenrek a53ae2782a libjson: added printing support (thanks spew) 2015-12-22 18:12:56 +01:00
cinap_lenrek f6e8b115d4 libjson: fix memory leak setjmp/longjmp problem (thanks spew)
spew → I fixed the memory leak setjmp/longjmp problem with libjson
spew → http://www.spew.club/json.patch
spew → full file: http://www.spew.club/json.c
spew → going to bed, I'll annoy cinap_lenrek tomorrow to try to get this committed
2015-12-22 17:00:00 +01:00
cinap_lenrek 9b0de7f9d6 tls: implement chacha20/poly1305 aead cipher suits 2015-12-21 04:55:54 +01:00
cinap_lenrek d19144155e kernel: missing changes for ibrk() prototype 2015-12-21 04:49:29 +01:00
aiju bdc2b75568 mpfmt: handle base 2, 4 2015-12-20 13:45:28 +01:00
cinap_lenrek a8f8de1cde import/expoerfs: dont assert() fault when ai->secret is > 8 bytes, just use the first 8 bytes 2015-12-16 21:30:56 +01:00
cinap_lenrek e83c9b3e61 auth/httpauth: use auth_userpasswd() instead of AuthHttp request to AS
the /sys/lib/httppasswords will be removed soon from authsrv,
so we use auth_userpasswd() to verify a username/password pair
instead.
2015-12-16 21:27:44 +01:00
cinap_lenrek 8a60d9e2a8 libsec: use tsmemcmp() when comparing hashes, use mpfield() for ecc, use mptober() when right adjusting mpint to bytes 2015-12-16 21:23:40 +01:00
cinap_lenrek efd3ac8a23 libmp: add mpfield() function for fast field arithmetic
instead of testing for special field primes each time in mpmod(),
make it explicit with a mpfiled() function that tests a modulus N
to be of some special form that can be reduced more efficiently with
some precalculation, and replaces N with a Mfield* when it can. the
Mfield*'s are recognized by mpmod() as they have the MPfield flag
set and provide a function pointer that executes the fast reduction.
2015-12-16 21:18:20 +01:00
cinap_lenrek b6f04b77e3 devprov: remove unused extern int unfair 2015-12-16 21:07:24 +01:00
cinap_lenrek 7be7d0681f kernel: use uintptr for ibrk() return value (for base >2GB) and clarify segbrk(2) 2015-12-16 21:06:51 +01:00
stanley lieber afe450d381 /sys/lib/dist/ndb/common: update for sl's auth servers 2015-12-11 14:18:06 -05:00
stanley lieber 55f6484f85 /lib/ndb/common: add auth=cb.inri.net authdom=nyc 2015-12-09 01:17:41 -05:00
aiju 15c6cd7555 mp: strtomp support for bases 2,4,8 2015-12-08 20:26:17 +01:00
aiju 609a9922ad mp: fix bug in mplogic.c; update mkfile 2015-12-08 19:43:22 +01:00
aiju 87abbc649f mp: add logic operations; mpfmt: include 0x with # 2015-12-08 18:29:22 +01:00
Matthew Veety 5f15532260 fixed spelling error in 2c(1) for the axp entry. 2015-12-07 18:55:26 -05:00
Matthew Veety 1c0ba2019e made sure that rcmain.local runs independent of the existence of $home/lib/profile. Documented /rc/lib/rcmain, /rc/lib/rcmain.local, $home/lib/profile in rc(1) and the first two in namespace(4) 2015-12-07 17:59:53 -05:00
cinap_lenrek 9e09742e9b yacc: attempt to keep line numbers right for yyparse()
as the generated parser intermixes lines from .y source
and the parser text, the line source/lineno for yyparse()
shows up wrong in the debugger. to make stack traces a
bit less crazy, put a #line 1 "/sys/lib/yaccpar" before
copying in the parser text.
2015-12-07 17:00:41 +01:00
cinap_lenrek d928a6f239 merge 2015-12-06 20:55:27 +01:00
cinap_lenrek 01afe9328b libmp: fix assert() for mpexp() with nil modulus 2015-12-06 20:53:54 +01:00
cinap_lenrek 1a5c8430d2 libmp: fix wrong move instruction for arm vector operations 2015-12-06 20:52:15 +01:00
aiju eccb144a71 winwatch: l allows label changes 2015-12-06 20:37:18 +01:00
cinap_lenrek 8d16e980c2 libmp: mpmod() fix typo 2015-12-01 11:25:08 +01:00
cinap_lenrek ffdfc17cee libmp: with mpmod() m = 2^a - c ensure that digits(c) < digits(m) 2015-12-01 11:13:52 +01:00
cinap_lenrek fbd825890e merge 2015-12-01 09:41:49 +01:00
cinap_lenrek 3a40210df8 libsec: fix genprime() to produce normalized result
this fixed bug "assert_failed_m-flags__mpnorm_since_283cc2200e34".
2015-12-01 09:40:24 +01:00
aiju 4770f60b18 mkone: yacc wants the D 2015-11-30 23:36:39 +01:00
cinap_lenrek bdaa002255 webcookies: strdup() file argument to avoid crash (thanks mischief)
mischief reports:

 acid: lstk()
 abort()+0x0 /sys/src/libc/9sys/abort.c:6
 ppanic(p=0x1bff4,fmt=0x1d749)+0x146 /sys/src/libc/port/malloc.c:166
         pv=0x1dad8
         msg=0x1e4a8
         v=0x3ffffe7c
         n=0x2f
 D2B(p=0x1bff4,v=0x3fffffae)+0x57 /sys/src/libc/port/pool.c:926
         a=0x3fffffa4
 poolfreel(v=0x3fffffae,p=0x1bff4)+0x20 /sys/src/libc/port/pool.c:1152
         ab=0x1dad8
 poolfree(p=0x1bff4,v=0x3fffffae)+0x3b /sys/src/libc/port/pool.c:1287
 free(v=0x3fffffb6)+0x23 /sys/src/libc/port/malloc.c:250
 readjar(file=0x3fffffb6)+0xce /sys/src/cmd/webcookies.c:473
         jar=0x1ea28
         lock=0x1ea68
         p=0x1ea6d
 main(argv=0x3fffffa0,argc=0x0)+0x10f /sys/src/cmd/webcookies.c:1295
         file=0x3fffffb6
         srv=0x0
         mtpt=0x1cfd0
         _argc=0x66
         _args=0x1cfe0
         home=0x0
 _main+0x31 /sys/src/libc/386/main9.s:16
 acid:
2015-11-30 20:08:22 +01:00
cinap_lenrek 1d8f2ac050 merge 2015-11-30 14:57:16 +01:00
cinap_lenrek 7f3659e78f kernel: cleanup exit()/shutdown()/reboot() code
introduce cpushutdown() function that does the common
operation of initiating shutdown, returning once all
cpu's got the message and are about to shutdown. this
avoids duplicated code which isnt really machine specific.

automatic reboot on panic only when *debug= is not set
and the machine is a cpu server or has no display,
otherwise just hang.
2015-11-30 14:56:00 +01:00
BurnZeZ 4badf9974f fplot(1): fix typo 2015-11-29 18:06:55 -05:00
stanley lieber a1a3af5586 fortunes: If you get this, delete it. - Sorry! -- Tim Berners-Lee, www-talk, Mon, 28 Oct 91 14:34:12 GMT+0100 2015-11-27 17:04:02 -05:00
stanley lieber 8043614f79 fplot(1): add BUGS section 2015-11-27 16:49:19 -05:00
cinap_lenrek 254031cf70 libsec: add chacha20 poly1305 aead, allow 64 bit iv's for chacha, add tsmemcmp()
chacha20 comes in two variants: ietf rfc7539, using 96 bit iv and 32 bit counter
and draft-agl-tls-chacha20poly1305 using 64 bit iv and a 64 bit counter. so
setupChachastate() now takes a ivlen argument which sets the mode.

add ccpoly_encrypt()/ccpoly_decrypt() routines.

to implement timing safe ccpoly_decrypt(), a constant time memcmp was needed, so
adding tsmemcmp() to libsec.
2015-11-26 15:25:10 +01:00
BurnZeZ 90695e2eb2 mpc: mpc.c is generated by yacc, so remove it on mk clean 2015-11-25 11:39:01 -05:00
cinap_lenrek d7303af06d rio: allow reading the image of a hidden window thru the window file 2015-11-25 04:31:30 +01:00
cinap_lenrek 9ef4ba83f6 rio: fix handling "resize" wctl for hidden windows
when the "resize" wctl was used on a hidden window, the window
was put back on the screen, however, it was not removed from
the hidden[] array so trying to hide the window again failed
because whide() assumed it was already hidden.

the fix is to not unhide the window, but preserve the hidden
state, so windows can programmatically be reshaped and moved,
but will remain hidden unless explicitely unhidden.
2015-11-25 04:30:44 +01:00
cinap_lenrek e82b10ffb4 disksim: don't assume 4-byte pointers 2015-11-24 11:02:04 +01:00
cinap_lenrek 518fd3ec83 rio: stop serving kbdin file (thanks eekee)
kbdfs already provides a /dev/kbdin file for the system, rio does
not need to provide one for the onscreen keyboard anymore.
2015-11-23 00:50:44 +01:00
cinap_lenrek 569bdd00c2 add mpc(1), extended precision code generator 2015-11-22 23:47:58 +01:00
cinap_lenrek ccfb9118a3 bootrc: remove usbwait hack, usbd/nusbrc are now synchronous by previous commit 2015-11-22 03:19:27 +01:00
cinap_lenrek 7e3b2cdb55 usbd: intoruce /env/usbbusy
to solve the usb device enumeration race on boot, usbd creates /env/usbbusy
on startup and once all devices have been enumerated and readers have consumed
all the events, we remove the file so nusbrc/bootrc can continue. this makes
sure all the usb devices that where plugged in on boot are made available.
2015-11-22 03:17:15 +01:00
cinap_lenrek 98363cb272 devenv: fix ORCLOSE handling
when opening a /env file ORCLOSE, and the process exits, envgrp() would
return nil can crash in envremove() because procexit will have set up->egrp
to nil before calling closefgrp().

the solution is to capture the environment on open, keeping a reference in
Chan.aux, so it doesnt matter on what process the close happens and a
env chan will always refer to its original environment group.
2015-11-22 02:39:57 +01:00
cinap_lenrek 38e1e5272f libmp: initial attempt at constant time code, faster reductions for special primes (for ecc)
introduce MPtimesafe flag to request time invariant computation
disables normalization so significant digits are not leaked.
2015-11-21 09:39:59 +01:00
aiju b677ab0c59 remove dunning-krugerrand code 2015-11-20 22:26:20 +01:00
cinap_lenrek 51bedde447 libmp: fix test program 2015-11-20 06:28:17 +01:00
cinap_lenrek 9fccf1629e libmp: add mpvecadd()/mpvecsub() assembly versions for arm 2015-11-20 06:25:56 +01:00
cinap_lenrek 2559e19e19 libmp: 386/amd64 mpvec*(): replace conditional branches with ADC/SBB instructions 2015-11-20 06:25:01 +01:00
cinap_lenrek 00572496ce kernel: use nicer check in okaddr(), wet floor signs in fixfault()
instead of checking addr+len >= addr, check len >= -addr so
that addr == 0 is never valid for len > 0 even if we decide
to have memory at the zero page so theres never any chance
user can pass in "nil" pointers.

put up some signs where we fall thru the switch cases in
fixfault()
2015-11-06 17:27:15 +01:00
cinap_lenrek b32300deb0 kernel: fix okaddr() check 2015-11-06 02:53:30 +01:00
cinap_lenrek 2ba46903fa merge 2015-11-01 12:14:00 +01:00
cinap_lenrek a4e32b43ea libmp: optimize case x/0xffffffff in mpdigdiv() (helps arm) 2015-11-01 12:12:41 +01:00
cinap_lenrek d901fbe4f1 libmp: add mpvecdigmuladd()/mpvecdigmulsub() assembly routines for arm 2015-11-01 12:10:10 +01:00
cinap_lenrek c184d2602d 5c: handle (rare) MULU instruction in peephole optimizer 2015-11-01 12:09:03 +01:00
stanley lieber 258c4fc0f8 fortunes: [9fans] FUSE on Plan9 2015-10-31 16:09:15 -04:00
stanley lieber 15bd0c52cc delkey(1): update man page to reflect recent changes. 2015-10-31 16:07:22 -04:00
cinap_lenrek cd3053a3cc devtls: reject SHA2_256 mac for SSL, but TLS is fine
sha256 is only defined for TLS1.2, however, technically, theres
no reason not to use it in TLS1.0/TLS1.1. the choice is up to
tlshand and pushtls, not the kernel.
2015-10-28 17:09:22 +01:00
cinap_lenrek 93d63dc1f3 mp(2): fix typo mnprand() -> mpnrand() 2015-10-28 13:39:17 +01:00
BurnZeZ 4587326e76 ascii: replace mnemonic np (new page) with ff (form feed) for consistency 2015-10-25 14:46:10 -04:00
BurnZeZ 8f27b8d04d rio: fix scrolling when cursor is above window 2015-10-24 22:57:07 -04:00
cinap_lenrek 847f3a0cf5 libsec: add chacha cipher (from charles forsyth) 2015-10-22 07:48:26 +02:00
cinap_lenrek 7effba9d98 libsec: add poly1305 2015-10-22 07:17:25 +02:00
stanley lieber a3c1557041 fortunes: Maybe a git branch can help here? 2015-10-19 11:56:03 -04:00
cinap_lenrek 24d74a4b5f acid/leak: fix endless loop for B2NB(b) == b case (thanks mischief) 2015-10-19 00:20:33 +02:00
cinap_lenrek 5ca4afb249 wifi: prioritize rsne over wpaie
if beacon/proble contains both wpa information element and rsne, the rsne wins.
2015-10-17 14:45:25 +02:00
cinap_lenrek 2f99484b9d merge 2015-10-15 13:22:48 +02:00
cinap_lenrek a034e629f7 lib9p: do not override Srv.end in listensrv(), simplify srvclose() and recounting
listensrv() used to override Srv.end() with its own handler
to free the malloc'd Srv structure and close the fd. this
makes it impossible to register your own cleanup handler.
instead, we introduce the private Srv.free() handler that
is used by listensrv to register its cleanup code. Srv.free()
is called once all the srv procs have been exited and all
requests on that srv have been responded to while Srv.end()
is called once all the procs exited the srv loop regardless
of the requests still being in flight.
2015-10-15 13:21:30 +02:00
aiju 27d2955ccf lib9p: add reqqueuefree 2015-10-12 10:41:40 +02:00
cinap_lenrek 9112daa764 libsec: remove rc4 cipher suits for tls 2015-10-10 01:12:30 +02:00
cinap_lenrek 13213681c9 aux/listen1: usage() 2015-10-10 00:11:03 +02:00
cinap_lenrek 47682ee42a aux/listen1: allow alternative namespace when running as user none with -n option 2015-10-10 00:09:02 +02:00
cinap_lenrek bab31af707 cwfs: fix wstat() failing to mark block dirty when noatime is set
code assumed the accessdir() call would always mark the block dirty, but
this is not the case when noatime flag is enabled. this was reported by
michael in bug:

"open/with_noatime_option_cwfs_doesnt_preserve_changes_in_file_permissionowner"

--
cinap
2015-10-09 19:22:53 +02:00
cinap_lenrek 9ec1a07af2 libsec: clarify the code by declaring constant for DirectoryString and handle conversion in mkstring() 2015-10-09 18:52:32 +02:00
cinap_lenrek 6bb63f7832 libsec: use the right string encoding for various x509 fields
C= has to be PrintableString, E= and DC= are IA5String, everything
else is DirectoryString which can be PrintableString or UTF8String.
2015-10-09 18:31:49 +02:00
cinap_lenrek 4040ea7a5e wifi: quote value of parsed ether options
introduce wificfg() function to convert ether->opt[] strings
to wifictl messages, which needs quoting for the value. so
etherX=type=iwl essid='something with spaces' works.
2015-10-09 05:10:47 +02:00
cinap_lenrek b29e414bc6 merge 2015-10-08 17:16:06 +02:00
cinap_lenrek 2598a9e312 cc: restore side(), but do not consider OINDEX as side effect free
from charles forsuth:

because the previous version thought OINDEX might have a side effect, it
stopped it building a tower of them.
probably the best thing is to limit that anyway, since each one consumes
2-3 registers, so towering them can
keep even more active, and the x86 hasn't got that many.

the quick hack is to return that case to the earlier state by treating
OINDEX as a side-effect in side().
it's not a bad thing to do in the OSTRUCT case, for similar reasons: it's
better to collapse the indexed pointer
into a direct register, instead of repeating the indexing operation through
the copying of the value.
OINDEX isn't a machine-independent operation, so it doesn't affect the uses
in ../cc
2015-10-08 17:14:07 +02:00
mischief 08e2333cc1 port: fix typo in devmnt mntproc name 2015-10-07 21:45:03 -07:00
cinap_lenrek 285d96be4d doom: fix bogus pointer arithmetic, do sfx initialization in two passes for linked sounds 2015-10-08 00:37:54 +02:00
cinap_lenrek fa1f9f7ca6 cc: back out side() change unil 8c is fixed
this change made 8c fail to build libvorbis and gs, until this
is fixed we can live with non-optimal code.
2015-10-07 13:35:36 +02:00
cinap_lenrek 7c7acbef31 qc: import changes from charles forsyth 2015-10-07 09:40:48 +02:00
cinap_lenrek 4a916ba86e kc: import various changes from charles forsyth 2015-10-06 06:55:05 +02:00
cinap_lenrek fe3430ea99 cc: include $builtin as keywoard in pickle() (from charles forsyth) 2015-10-06 06:47:55 +02:00
cinap_lenrek 37d2856f55 cc: getflag() fmt will be terminated at end of loop (from charles forsyth) 2015-10-06 06:38:37 +02:00
cinap_lenrek 651b2a32be cc: allow runes as macro names (from charles forsyth) 2015-10-06 06:34:30 +02:00
cinap_lenrek 2d59b15c39 5c/6c/8c/vc: import various changes from charles forsyth
- cover more cases that have no side effects
- ensure function has complex FNX
- pull operators out of OFUNC level
- rewrite OSTRUCT lhs to avoid all side-effects, use regalloc() instead of regret()
2015-10-06 06:20:01 +02:00
cinap_lenrek 99ddc5b097 cc: TUSHORT -> TRUNE for lstring constats for OUSED 2015-10-06 05:20:00 +02:00
cinap_lenrek b33f4c0301 9660srv: do not ignore upper 32 bits of offset when reading directory 2015-10-05 04:45:32 +02:00
cinap_lenrek 0e09795831 dossrv: handle file offsets > 2^31
maximum file size is 4GB-1 as the file length is stored in
a 32 bit long. make sure it doesnt overflow on write or
or truncate. interpret the file length as unsigned. pass
vlong to readfile()/writefile()/truncfile() so we can
handle overflows and not just ignore the upper bits.
2015-10-05 04:31:31 +02:00
cinap_lenrek ec51877698 6c: remove 6c/vlrt.c file 2015-10-04 22:12:16 +02:00
cinap_lenrek 36876b9522 8c: dont abort() when running out of registers. 2015-10-04 22:09:36 +02:00
cinap_lenrek a23d7cdb84 vc: fix mistake. 2015-10-04 21:22:17 +02:00
cinap_lenrek 1dd7f0893b ape: add missing _subv() function to 386/vlop.s 2015-10-04 20:16:41 +02:00
cinap_lenrek b556e87e08 vc: handle 64 bit mixedmode asop 2015-10-04 20:08:10 +02:00
cinap_lenrek 8e41723741 5c: handle 64 bit mixedmode asop 2015-10-04 20:07:34 +02:00
cinap_lenrek e6d64bab9d 8c: handle 64 bit mixedmode asop and type vlong <-> float/double type conversions 2015-10-04 20:06:59 +02:00
cinap_lenrek 107ca1b42d cc: handle 64 bit mixedmode asop and type vlong <-> float/double type conversions 2015-10-04 20:06:30 +02:00
cinap_lenrek bfd0cb0db4 cc/6c: fix return type of mixed asop expressions, preserve type for moves so fixed<->float conversions work correctly 2015-10-04 20:02:58 +02:00
cinap_lenrek 9e3ef5c777 ape: add machine specific code for spim 2015-10-04 19:50:24 +02:00
cinap_lenrek d2af6b40af libc: add _uv2d()/uv2f() and _vas*d() functions to vlrt.c
on 32 bit archs, implement 64 bit vasop with floatingpoint right hand side.
also added is uvlong->double conversion function.
2015-10-04 19:49:02 +02:00
cinap_lenrek 9124e491e5 merge 2015-10-03 12:19:31 +02:00
cinap_lenrek 74a557a167 8c: make cgen64() compile target first when it contains functoin call so final assignment wont trash the registers 2015-10-03 12:18:20 +02:00
mischief 20dc40d19b pc, pc64: add did for intel wildcat point audio controller 2015-09-29 18:44:30 -07:00
aiju fe06f8e571 add timepic(1) and qr(1) manpages 2015-09-29 20:49:52 +02:00
aiju a7b06e0fdd timepic: string support 2015-09-29 20:49:28 +02:00
cinap_lenrek cde69a7822 ape: set MB_CUR_MAX to 4 in stdlib.h for 21-bit runes (thanks erik quanstro)
> fix silly bug with ape/stdlib.h which caused ape/lib/regexp/regcomp.c
> to miscompile regular expressions with runes > 0xffff.
2015-09-29 15:17:21 +02:00
BurnZeZ 695f0e0694 aux/gpsfs: fix usage 2015-09-29 04:08:42 -04:00
BurnZeZ ed196fcb7e file: detect DICOM and XM audio headers 2015-09-28 03:42:26 -04:00
cinap_lenrek 8a784a3b9b devip: declare cleanarpent() static 2015-09-27 22:41:38 +02:00
cinap_lenrek 4449a34756 devip: various bugfixes and cleanups for arp code
- fix missing runlock(ifc) when ifcid != a->ifcid in rxmitsols() (thanks erik quanstro)
- don't leak packets when transfering blocks from arp entry hold list to droplist
- free rest of droplist when bwrite() errors in arpenter(), remove useless checks (ifc != nil)
- free arp entry hold list from cleanarpent()
- consistent use of nil for pointers
2015-09-27 22:17:02 +02:00
aiju 920783505c add timepic(1) 2015-09-27 13:50:18 +02:00
stanley lieber 4c841d0b46 fortunes: Please be respectful in this forum. 2015-09-26 19:10:40 -04:00
stanley lieber f9244d433a qer(8): correct man page example (thanks, kenji) 2015-09-26 19:07:05 -04:00
cinap_lenrek c124b9f8b2 merge 2015-09-26 11:46:31 +02:00
cinap_lenrek ffe4844da8 cwfs: various cleanups
- consistently refer to Dentry.name length with NAMELEN
- make sure whoname is null terminated
- remove useless nil check for whoname
2015-09-26 11:44:29 +02:00
cinap_lenrek 76e0968e35 cwfs: don't use sprint() to fill directory name
sprint() will replace invalid utf8 sequences with U+FFFD
which caused directory reads and stats to return the wrong
filename. just strcpy the name bytes.
2015-09-26 11:41:31 +02:00
mischief 8737864294 ape: add badrect object into ape libdraw 2015-09-25 16:44:25 -07:00
cinap_lenrek fc06f637cf libsec: cleanup newbytes()/newints()/newbits() and get rid of OFFSETOF() macro 2015-09-24 12:57:05 +02:00
cinap_lenrek 917da0089d cpp: handle 4 byte utf sequences (21-bit runes) 2015-09-24 12:23:17 +02:00
cinap_lenrek 8003c8b1e2 utf(6), rune(2): document 21-bit runes 2015-09-24 12:14:08 +02:00
cinap_lenrek bba6d26ca2 cpp: fix memory corruption due to input buffer relocation
the dynamic input buffer resize code (fillbuf()) is broken as
the calling code assumes that memory wont relocate. instead
of trying to work out all the cases where this happens, i'm
getting rid of fillbuf() and just read the whole file into
memory in setsource().

the bug could be reproduced with something as simple as:

@{for(i in `{seq 1 10000}){echo $i ', \'; }} | cpp
2015-09-24 05:13:03 +02:00
glenda 2b5ab91775 resize: add -n for nearest neighbour 2015-09-23 17:52:35 +02:00
cinap_lenrek fa95531388 merge 2015-09-23 17:35:16 +02:00
cinap_lenrek 6641548938 libsec: fix memory leaks in X509req() and X509gen() and return malloced pointer
X509req() and X509gen() used to leak memory, and had no way for
the caller to free the allocated certificate/certificate request
buffer returned. this is not critical as these functions are only
used in short lived rsa(2) helper programs. but i prefer to have
library routines not leak memory as one does not know in advance
where the code is going to be used.
2015-09-23 17:33:52 +02:00
cinap_lenrek 5639f9504b rsa2x509, rsa2csr: add newline in usage print 2015-09-23 17:05:48 +02:00
cinap_lenrek 9f50ee06f3 libsec: implement client certificate authentication for tls1.2
we used to negotiate tls1.1 for client cert authentication because the
signature generation was not implemented for tls1.2. this is now fixed
and tls1.2 can be negotiated with client certs.
2015-09-23 16:57:25 +02:00
glenda d6c35b3de8 add qr.c 2015-09-23 16:36:55 +02:00
cinap_lenrek ada54defbc libsec: handle missing signature case; can happen because some ciphers make it optional 2015-09-22 19:11:54 +02:00
cinap_lenrek 2c4d3dd510 libsec: make sure Elem is zero initialized so freevalfields() wont cause accidents 2015-09-22 18:39:48 +02:00
cinap_lenrek c3e1c158f6 libsec: implement dh parameter signature verification, stop lying about non-rsa ciphers, fix memory leaks in X509 code
actually verify the diffie hellman parameter signature, this
comes in two flavours. TLS1.2 uses X509 signature with a
single hash specified by the signature algorithm field in
the signature itself and pre TLS1.2 where md5+sha1 hashes
of the signed blob are pkcs1 padded and encrypted with the
rsa private key.

stop advertizing non-rsa cipher suits (DSS and ECDSA), as
we have not implmenented them.

fix some memory leaks in X509 code while we'r at it.
2015-09-22 18:10:52 +02:00
cinap_lenrek 8baa859319 libsec: fix memory leak in ecmul() 2015-09-22 18:04:06 +02:00
cinap_lenrek c878be04f9 scuzz: uncomment synccache command 2015-09-22 12:23:49 +02:00
cinap_lenrek 83d45ee502 mothra: <hr> drawing
<hr> is handled by drawing replicated bitmap across the with of
the page.
2015-09-22 11:49:07 +02:00
cinap_lenrek 95cfc30788 libdraw: remove unneeded check (thanks BurnZeZ) 2015-09-20 21:52:47 +02:00
cinap_lenrek 12f7fc7a08 devsd: handle SYNCHRONIZE CACHE scsi commands as nops in sdfakescsi() 2015-09-20 14:54:49 +02:00
cinap_lenrek fa769a8f9d sdmmc: handle fakescsi emulation 2015-09-20 14:53:44 +02:00
cinap_lenrek c7c58ef8bb devsd: remove unused timeout field from SDreq 2015-09-20 14:27:41 +02:00
cinap_lenrek d1315ade41 libdraw, screenrc: bind devdraw and devmouse in screenrc instead of handling it in libdraw
libdraw was attempting to bind '#i' and '#m' to /dev when it could not find
/dev/mouse or /dev/draw. a library shouldnt be that clever and do namespace
manipulations on behalf of the caller. so instead, we setup the graphics
environment in screenrc on boot time.
2015-09-20 12:25:01 +02:00
mischief 30a9d59070 pc, pc64: fix sdvirtio descriptor count when sending flush 2015-09-20 01:56:56 -07:00
stanley lieber f5174e6fdf ircrc: add -P option for server password (thanks, nick) 2015-09-19 14:03:22 -04:00
stanley lieber a90662c2e6 /sys/lib/dist/ndb/common: correct authdom=inri 2015-09-16 13:29:04 -04:00
cinap_lenrek cb083221d2 igfx: fix typos (thanks qwx) 2015-09-14 15:15:14 +02:00
cinap_lenrek 029c271825 libsec: save some space making weakCipher bitamp of type char[] instead of int[] 2015-09-14 09:46:40 +02:00
cinap_lenrek 9733434e6e libsec: add TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 and TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 cipher suits 2015-09-14 09:27:06 +02:00
cinap_lenrek be3ba38c45 libfis: fix wrong shift for lba40 (thanks geoff and charles)
---------- Forwarded message ----------
From: Charles Forsyth <charles.forsyth@gmail.com>
Date: 13 September 2015 at 12:38
Subject: fis bug
To: erik quanstrom <quanstro@quanstro.net>


geoff spotted something similar in sdiahci.c, but it's in libfis as well:

c[Flba24] = lba >> 24;
c[Flba32] = lba >> 32;
c[Flba40] = lba >> 48;

>> 48??  should be >> 40, especially with drive sizes getting up there.
2015-09-13 13:51:00 +02:00
cinap_lenrek 33a4a56c1c libsec: send sigature_algoritms extension for TLS1.2, order ciphers
TLS1.2 requires the client to send the list of supported
signature and hash algorithm pairs. some servers will simply
reject the client hello otherwise. note that we do not implement
any dh/ecdh param signature verification.

order the cipher list to strogest first. aes128 is actually more
secure than aes256.
2015-09-13 13:39:51 +02:00
cinap_lenrek 455b42743d libsec: handle TLS 1.2 changes in CertificateRequest message 2015-09-12 13:04:47 +02:00
cinap_lenrek c06e464ec4 cwfs: initialize /env/timezone on boot so dumps are in localtime
when /env/timezone file is missing (boot case), copy /adm/timezone/local
to /env/timezone so localtime() can correct timezone offset.
2015-09-12 03:58:46 +02:00
mischief c823f136df mkfile.proto: LIB should not be inherited during recursive mk 2015-09-09 18:59:40 -07:00
cinap_lenrek 20ea629b8a html2ms: bold table headings, remove wrong tag space handling 2015-09-08 19:55:55 +02:00
cinap_lenrek d79754b4c8 mothra: make text inside <td> bold 2015-09-08 19:23:23 +02:00
cinap_lenrek b143c1f411 tar: remove unneccesary { } 2015-09-08 18:30:38 +02:00
cinap_lenrek c7eae3fb72 tar: make z flag work, even when no file name was provided (thanks aiju)
tar used to infer compression type from the filenames extension, but when
no file name is given (stdin/stdout), the -z flag was ignored and no
compression filter applied. this changes tar to assume the default
gzip compression method when z is given and no file name is specified.
2015-09-08 18:27:48 +02:00
cinap_lenrek 4d4b825dea mothra: add missing initializations for plaintext html state 2015-09-07 00:13:40 +02:00
cinap_lenrek b55315c3fd libthread: get rid of tprivalloc()/tprivfree()/tprivdata() and _workerdata() (thanks qrstuv)
these functions where undocumented and unused. especially
tprivfree() was buggy missing a unlock() call. theres not
much point in supporting these functions as theres
threaddata() and procdata().
2015-09-06 23:25:14 +02:00
cinap_lenrek 7562da90e5 libc: remove privfree(), simplify privalloc() 2015-09-06 20:43:05 +02:00
cinap_lenrek 431cbe35f6 devqspi: fix qunlock error on stat() -> close() 2015-09-05 13:18:28 +02:00
cinap_lenrek fdfd856d1d zynq: clean cache unconditionally *before* dma, invalidate cache *after* dma for read case
processor might bring data speculatively into the cache,
before the dma completes.
2015-09-05 10:36:53 +02:00
cinap_lenrek 6fb9ae8f43 usbehci: clean cache unconditionally before handing a buffer to the hardware
even in the read case, we need to clean the cache
so the cpu will not flush out old changes while
the hardware updates the buffer.
2015-09-05 10:14:19 +02:00
cinap_lenrek 50850cf4b9 dist/mkfile: add target for the aijuboard *.zynq.img
this generates a disk image (to be written to usb or
sdmmc card) containing 9fat partition with kernel and
a hjfs filesystem partition with the 9front distribution.

this could be easily extended to generate raspberry pi
images as well, but i have no hardware to test.
2015-09-05 03:29:17 +02:00
cinap_lenrek ce38e57e97 merge 2015-09-05 00:37:32 +02:00
cinap_lenrek faf3f0df06 zynq: fix cache flush bug for emmc driver (have to invalidate cache *before* read) 2015-09-05 00:33:57 +02:00
stanley lieber 891ca82987 fortunes: Please be respectful in this forum. 2015-09-03 17:01:49 -04:00
cinap_lenrek b9eb7258bd html2ms: handle subscripts and superscripts 2015-09-03 21:24:00 +02:00
cinap_lenrek 72a5fbd8ea mothra: subscript and superscript support 2015-09-03 19:07:48 +02:00
cinap_lenrek c8dd01d5f6 auth/passwd: fix structure zeroing order 2015-09-02 11:41:41 +02:00
cinap_lenrek 7ed22aaeec libsec: add rfc5869 hmac-based key derivation function hkdf_x() 2015-09-02 11:30:17 +02:00
cinap_lenrek b749f36baa libsec: generalize pbkdf2_hmac_sha1() to pbkdf2_x() passing the hmac as an argument 2015-09-02 11:28:11 +02:00
cinap_lenrek 4c52aedfe9 libsec: declare aes_setupEnc static 2015-09-02 06:15:02 +02:00
cinap_lenrek 46926aa502 tcp: fix mtu on server sockets again (thans mycroftix)
for incoming connection, we used s->laddr to lookup the interface
for the incoming call, but this does not work when the announce
address is tcp!*!123, then s->laddr is all zeros "::". instead,
use the incoming destination address for interface mtu lookup.

thanks mycroftix for troubleshooting!
2015-09-02 01:50:55 +02:00
cinap_lenrek b5737e8726 libsec: add curve25519 diffie hellman 2015-09-01 21:38:20 +02:00
cinap_lenrek e3a64494e7 libsec: remove flawed aes() digest and hmac_aes() implementations (thanks aiju) 2015-09-01 21:35:43 +02:00
cinap_lenrek 2095bdbf45 libsec: work arround 8c running out of registers compiling curve25519.c 2015-08-28 16:31:44 +02:00
cinap_lenrek 0e51046942 libsec: add curve25519() from http://code.google.com/p/curve25519-donna/
this is a portable version of curve25519() by google.
2015-08-28 12:08:54 +02:00
cinap_lenrek d8a57c0ae3 merge 2015-08-28 08:42:35 +02:00
cinap_lenrek d52e35055d libauthsrv: fix _asgetresp() for passwd 2015-08-28 08:41:16 +02:00
glenda 2bc15fbabd mp.h: third time's a charm 2015-08-27 13:40:34 +00:00
glenda 82a922d9ed mp.h: oops 2015-08-27 13:35:13 +00:00
glenda d8a1f1a647 mp.h: define mpnrand 2015-08-27 13:34:02 +00:00
mischief 07b245943a libsec: add TLS_RSA_WITH_AES_128_CBC_SHA256 and TLS_RSA_WITH_AES_256_CBC_SHA256 ciphers 2015-08-27 01:53:48 -07:00
mischief 163a772124 devtls: add sha256 mac 2015-08-27 01:46:28 -07:00
cinap_lenrek 3bb0b9f4ea libsec: add q parameter to dh_new() for subgroup support, sanitize dh parameters 2015-08-26 05:59:42 +02:00
cinap_lenrek 844bbecadb libmp: simplify mpnrand(), as mpnew() cannot return nil 2015-08-26 05:44:26 +02:00
cinap_lenrek 8f2e408448 libmp: add mpnrand() function to generate uniform random number 0 ≤ x < n 2015-08-25 20:20:25 +02:00
mischief 2dec35524e tput: check sbrk return value 2015-08-25 03:06:36 -07:00
glenda c4fdc6bfdb fix fuckup 2015-08-25 09:35:10 +00:00
mischief 6b402b83cf import E script from bell labs 2015-08-25 02:07:46 -07:00
mischief dbe0a995f0 libc: import more endianness fixes (thanks cherry9)
from https://bitbucket.org/cherry9/plan9-loongson/
2015-08-25 01:58:41 -07:00
cinap_lenrek 59d16c3900 libsec: fix probably_prime() endless loop for n == 3 2015-08-23 23:49:31 +02:00
cinap_lenrek 54a91861df remove convkeys2 2015-08-22 00:21:11 +02:00
cinap_lenrek b83dd93e98 init: remove dependency to <authsrv.h> 2015-08-21 23:40:31 +02:00
cinap_lenrek d24610fe38 tapefs: remove dependency to <authsrv.h> 2015-08-21 23:38:56 +02:00
cinap_lenrek 5c941ec346 import(4): -o, -O flags gone 2015-08-21 23:29:10 +02:00
cinap_lenrek 69dd87eb63 remove srvold9p 2015-08-21 23:23:35 +02:00
cinap_lenrek 61e9d23eb2 cpu, import: remove old9p support 2015-08-21 23:22:59 +02:00
cinap_lenrek c6a9cbb071 cmd/auth: remove private /dev/random reading routines, use genrandom() 2015-08-21 22:46:26 +02:00
cinap_lenrek 809522e80f auth/changeuser: set the aes key in plan9 database, but not in securenet db 2015-08-21 20:36:19 +02:00
cinap_lenrek f6dbd3d993 keyfs: fix typo (thanks jpm) 2015-08-21 20:11:11 +02:00
cinap_lenrek c96efcfef3 kernel/boot: do not handle kfs boot 2015-08-21 19:53:43 +02:00
cinap_lenrek 77e279201d remove kfs and kfscmd 2015-08-21 19:52:57 +02:00
cinap_lenrek cb474632d3 remove kfs references from manual 2015-08-21 19:51:03 +02:00
cinap_lenrek 3db2012126 fshalt: remove kfs support 2015-08-21 19:40:29 +02:00
cinap_lenrek 985b2457cd mkfs(8): dont mention kfs 2015-08-21 19:35:56 +02:00
cinap_lenrek 46a7876d32 disk/mkfs: rmeove kfs support 2015-08-21 19:32:48 +02:00
cinap_lenrek 0ce50ebc57 cwfs: remove 9p1 support 2015-08-21 18:43:25 +02:00