Commit graph

5034 commits

Author SHA1 Message Date
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
Matthew Veety 04a8392f8c Added change to /rc/lib/rcmain to allow execution of /rc/lib/rcmain.local if it exists. /rc/lib/rcmain.local is similar to $home/lib/profile in that it will only be executed with -l, but is site-wide. 2015-12-07 16:01:09 -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