Commit graph

4617 commits

Author SHA1 Message Date
spew ff8ae67b70 libregexp: miscellaneous little cleanups 2017-04-30 15:08:36 -05:00
cinap_lenrek c00c60d327 sshfs: fix -r / retulting in "//foo" paths, memory leaks, use estrdup9p()
just use cleanname() to implement pathcat(), which
handles double slashes and ".." elements already.

have to free the partial dir structue on error in
parsedir().

use estrdup9p() instead of strdup().
2017-04-30 18:28:06 +02:00
cinap_lenrek 607e651c06 vnc: substitute iprint() with fprint(2, (gone from libmemdraw) 2017-04-30 04:06:03 +02:00
cinap_lenrek 24420ab9eb kernel: fix rewinding in directories with pread() offset
reading directories with pread() offset has to work the same
way as read(), otherwise exportfs breaks rewinding in directories.
2017-04-30 01:51:07 +02:00
cinap_lenrek f8478eb4c4 lib9p: allow rewinding in 9pfile directories 2017-04-30 01:49:21 +02:00
cinap_lenrek 56611ced39 libmemdraw: get rid of kernel iprint() emulation 2017-04-29 21:13:48 +02:00
cinap_lenrek 9a5e55782d libmemdraw/libmemlayer: get rid of drawdebug prints 2017-04-29 21:10:28 +02:00
cinap_lenrek 3c894ece0c devdraw: ignore drawdebug command 2017-04-29 21:09:11 +02:00
cinap_lenrek d4a6dc8910 libdraw: get rid of _drawdebug variable 2017-04-29 21:03:52 +02:00
aiju ca2fa9596b sshfs: add -r and -M options 2017-04-29 18:44:01 +00:00
cinap_lenrek b4b2cd72b0 cwfs: allow "none" user to rename files 2017-04-29 17:28:35 +02:00
cinap_lenrek 51eaebf4f0 sshfs: don't crash when no /etc/password file could be read on the remote side
in a cygwin environment, theres no /etc/passwd file to
translate numeric uid/gid's. changing passwdparse() to
ignore nil string argument.
2017-04-29 16:25:48 +02:00
aiju f00488ec70 sshfs: check correctly for directory bits; calculate parent directory correctly 2017-04-28 20:42:38 +00:00
aiju 7cc9d944df sshfs: reset SReq->reqid field to fix double-free of request ids 2017-04-28 18:45:32 +00:00
aiju 5ce3f70f72 sshfs: remove debug print 2017-04-28 18:32:04 +00:00
aiju 825ab5d286 sshfs: don't cache directory contents 2017-04-28 18:21:03 +00:00
aiju 11954a19a6 sshfs: look up uid/gid from /etc/^(passwd group) 2017-04-28 16:34:24 +00:00
aiju 562fd5b134 add sshfs 2017-04-28 15:41:48 +00:00
aiju 2a920e7361 ssh: add support for subsystems 2017-04-28 15:41:39 +00:00
cinap_lenrek 522f08e5f1 upas/fs: fix warning about unused Err: label 2017-04-27 20:06:00 +02:00
aiju 66c22f3908 games/md: copy updated cpu.c from blit 2017-04-27 08:46:44 +00:00
aiju 042f98784a ssh: make number of retries configurable 2017-04-24 23:26:43 +00:00
aiju ef7b428832 ssh: loop keyboard-interactive on failure 2017-04-24 23:16:59 +00:00
aiju fbf64184df ssh: fix typo 2017-04-24 16:07:34 +00:00
aiju f8eb5a1d13 ssh: add "none" method to find out list of acceptable methods 2017-04-24 16:04:09 +00:00
cinap_lenrek 42f449b9ce ssh: print the whole ssh-rsa hostkey in base64 when thumb check fails
in addition to the thumbprint, also print the whole
hostkey in base64 (same format as openssh uses) to
make verification easier.
2017-04-24 01:46:22 +02:00
cinap_lenrek 346f5828e0 libsec: sha256 support for thumbprint files, use it in ssh as well
initThumbprints() now takes an application tag argument
so x509 and ssh can coexist.

the thumbprint entries can now hold both sha1 and sha256
hashes. okThumbprint() now takes a len argument for the
hash length used.

the new function okCertificate() hashes the certificate
with both and checks for any matches.

on failure, okCertificate() returns 0 and sets error string.

we also check for include loops now in thumbfiles, limiting
the number of includes to 8.
2017-04-23 19:00:08 +02:00
cinap_lenrek 2d1fbbdafa upas/fs: don't abort on malformed unix header 2017-04-23 18:42:26 +02:00
cinap_lenrek da0a7ac387 ssh: implement primitive hostkey verification
this checks $home/lib/sshthumbs for the sha256 hash
of the hosts rsa public key. if its not there, it
prints the rc command to add it and exits.
2017-04-23 02:54:41 +02:00
cinap_lenrek 83d5c827b7 vt: handle underline attribute 2017-04-22 22:52:34 +02:00
cinap_lenrek f80b35faca merge 2017-04-22 22:21:47 +02:00
cinap_lenrek 13a74150ac vt: handle nocolor flag and reversed background colors 2017-04-22 22:19:17 +02:00
spew 7986722cec merge 2017-04-22 14:28:34 -05:00
spew 6261dcb06b replica: use libavl for avl tree implementation 2017-04-22 14:28:02 -05:00
cinap_lenrek c029a0c913 vt: handle insert/delete/home/end keys for vt220/xterm 2017-04-22 21:07:53 +02:00
spew 9cf5198145 libavl: lookup can return the closest match 2017-04-22 13:59:37 -05:00
cinap_lenrek f2b7f24e4e vt: handle application/normal mode (really fixes cursor keys) 2017-04-22 20:16:07 +02:00
cinap_lenrek b58584b057 merge 2017-04-22 18:21:57 +02:00
cinap_lenrek 5d7a77cf57 vt: fix xterm cursor keys 2017-04-22 18:01:49 +02:00
cinap_lenrek 4340dd1b2f merge 2017-04-22 02:42:16 +02:00
cinap_lenrek c5b2927250 vt: fix background drawing 2017-04-22 02:41:00 +02:00
mischief 5ef9330b6f nusb/ptp: treat any assocation as a directory
previously nusb/ptp showed only 'generic folder' association type as directories, but all associations work as directories. tested with LG G5/android 7.0
2017-04-21 15:09:50 -07:00
cinap_lenrek ccdb4fca83 merge 2017-04-21 19:25:25 +02:00
cinap_lenrek a944c37d68 ssh: actually handle flow control and channel id's 2017-04-21 19:23:56 +02:00
aiju 094fc8b15f fix yacc bug (found by dan cross) 2017-04-21 17:16:44 +00:00
cinap_lenrek 99825e22ed ssh: increase initial window size for better throughput 2017-04-21 01:45:11 +02:00
cinap_lenrek 882f1c492e ssh: cleanup debug messages 2017-04-21 00:09:30 +02:00
cinap_lenrek 9c50712d64 ssh: do not try authentication methods that we know are not possible 2017-04-20 23:45:56 +02:00
cinap_lenrek 2e714ffe7c ssh: implement password and keyboard-interactive authentication methods 2017-04-20 22:28:21 +02:00
cinap_lenrek bef681b892 vt: cursoron, don't resize winow when replying history 2017-04-19 22:34:47 +02:00
cinap_lenrek d566a5ca6b ssh: fix locking, and key reexchange handling
when we initiate re-key exchange we data packets can still
come in. so instead we have everything that can come in all
the time in dispatch() function (including KEXINIT) and have
the receiver process just call that in a loop. exclude dispatch
and the sender proc from corrupting each others sendpkt() calls
with the QLock sl.
2017-04-19 21:03:26 +02:00
aiju b795a6d9dc blit: always show top-left corner; add tony kaku's -m flag 2017-04-19 10:13:36 +00:00
cinap_lenrek 283a1c0788 vt: but not too fast :-)
if drawing can't keep up with the host, make sure we
eventually redraw the screen and check for user events.
2017-04-19 02:18:28 +02:00
cinap_lenrek 219050cc36 vt: make it fast 2017-04-19 01:46:20 +02:00
cinap_lenrek db729cbb50 vt: send interrupt on exit, open logfile OCEXEC, run host after environment got exported, send rest of arguments to host 2017-04-18 03:13:15 +02:00
cinap_lenrek d4cc35f387 ssh: close the channel when vt hangs up 2017-04-18 03:06:39 +02:00
cinap_lenrek 378866d6d1 vt: allow for a bit of buffering 2017-04-18 00:21:51 +02:00
cinap_lenrek 1333b4d14e vt: convert from event to threads
the event library doesnt do any flow control. if the host
keeps sending data while the user is mousing arround,
extract() will collect the data until memory fills up.

so instead we abandon the event library and convert
the program to use channels.
2017-04-18 00:18:03 +02:00
cinap_lenrek 1f3f4cd06b vt: increase history buffer to 64K runes 2017-04-17 05:32:01 +02:00
cinap_lenrek 33991ab9cc ssh: weekend project
manpage should follow...
2017-04-17 05:22:16 +02:00
cinap_lenrek 128783a700 factotum: append public rsa encyption exponent after the modulus
this makes implementing ssh-rsa authentication easier, as we
then can convert the public key directly to ssh format and check
if the server will accept that public key.

tlshand just needs the modulus to see if the public key matches
the one it has from the certificate.
2017-04-17 05:18:24 +02:00
cinap_lenrek 242274f733 rsa2ssh: drop support for version 1 key format 2017-04-17 05:13:46 +02:00
cinap_lenrek ddc6c16515 vt: implement snarf support 2017-04-17 05:12:07 +02:00
cinap_lenrek 34f5a83330 pc64: state mp.h dependency for archacpi.$O 2017-04-11 02:26:39 +02:00
cinap_lenrek 075e1ddd7d upas/fs: remove imap lastread debounding
its unclear why this was here, waketime logic should handle
this already.
2017-04-09 04:36:47 +02:00
cinap_lenrek 1d94a18e56 upas/fs: fix sync condition
we used to check for mb->d->name != nil before stating, to avoid
stating pop3/imap mailboxes who don't really have a local file,
but this breaks when the md->d is reconstructed (faked) from
the index! resulting in the mailbox stop being refreshed.

the solution is to not have mb->d == nil for imap/pop mailoxes.
2017-04-09 04:32:38 +02:00
cinap_lenrek 35f6a75355 upas/fs: make use of Maxmsg consistent 2017-04-08 23:01:19 +02:00
cinap_lenrek 445d64a387 upas/fs: simplify imap4read() 2017-04-08 23:00:48 +02:00
cinap_lenrek f14ad276c2 upas/fs: fix dir comparsion and skip directories in mdir, avoid stat
- ignore directories in dirskip()
- use sortkey of 0 for invalid items, otherwise it could confuse qsort()
- use file size from dirreadall() instead of doing stat
- various cleanups
2017-04-08 22:59:15 +02:00
cinap_lenrek a208a93733 upas/send: use openfolder() to deliver mail to avoid code duplication 2017-04-08 22:52:06 +02:00
cinap_lenrek fd78f6722e upas/common: deliver mail to mdir as .tmp file and rename after it has been fully written
theres a race condition when mail delivery to mdir is slow,
then upas/fs sees partial mail file and caches the truncated
file size.

to avoid this, delivery will create the new mail file with
the .tmp extension (which is ignored by upas/fs) and after
everything has been written, rename it to the final name.
2017-04-08 22:50:17 +02:00
cinap_lenrek 00fbdd622a kernel: avoid waserror() botch in devwalk (from drawterm, thanks aiju)
calculate alloc flag before waserror(), as compilers like
gcc will not notice the value changing later because
setjump() restores the old value due to callee-saves.

change is applies here to make it easier to merge with
drawterm.

thanks to aiju for debugging this; used to cause drawterm
memory leak until compiled with gcc -O0.
2017-04-05 00:34:07 +02:00
cinap_lenrek 30c05fe3dd kernel: fix memory leak in checkpagerefs() debug function (thanks aiju) 2017-04-04 20:13:31 +02:00
cinap_lenrek 249ff9a24c tlshand: simplify tlsReadN() 2017-04-04 19:01:57 +02:00
cinap_lenrek de80075fc6 tlshand: fix mpint to bytes conversion, reorganize send/recv buffer, check for overflow in msgSend()
when converting mpint to bytes, always pad it to the size of
the modulus (RSA,DHE,ECDHE). mptobytes() now takes a byte len
parameter which the caller usually calculates from the group
modulus using mpsignif(). this bug sometimes caused "bad record mac"
after the handshake.

use a shared buffer, given that msgSend()/msgRecv() don't overlap
we can use the first half for sending, and the top half for
receiving, shifting down as neccesary. the space beween sendp and
recvp is free.

explicitely check for overflow in msgSend().
2017-04-04 01:59:17 +02:00
cinap_lenrek 6ff5c10ffb tlshand: fix ECDHE and DHE for SSLv3 2017-04-03 02:48:47 +02:00
cinap_lenrek 8829d51f50 devvga: remove unused copy of checkport() function 2017-04-02 20:17:44 +02:00
cinap_lenrek 8ea31ae7b2 devvga: fix mistake 2017-04-02 20:10:44 +02:00
cinap_lenrek a6d852d0a6 devvga: include hwgc in vgactl file 2017-04-02 20:08:15 +02:00
cinap_lenrek 6a1841dce5 aux/wpa: go to background when not prompting, handle open networks 2017-04-02 19:05:56 +02:00
aiju e09adf5944 pc(1): fix memory leak and add clog() function 2017-04-02 14:47:23 +00:00
cinap_lenrek e0087b2a78 nusb/lib: make usbcmd() return value symmetic; returning size of data phase (if any) (thanks aiju)
usbcmd() with Rh2d used to return the command size (8+ndata) wile returning
only ndata for Rd2h. this changes it to always return ndata for Rh2d. it
mostly doesnt matter as Rh2d callers only check r < 0 for error, but this
makes the interface symmetic.
2017-04-01 22:19:58 +02:00
cinap_lenrek 25725eb0ad hjfs: avoid 8c "non-interruptable temporary" warning 2017-04-01 15:21:28 +02:00
aiju 089d493d96 chgrp: remove unused function declaration (thanks archeus) 2017-04-01 09:01:26 +00:00
aiju 4175b19c94 games/blit: remove strange debugging line 2017-04-01 08:57:03 +00:00
cinap_lenrek d801a4f300 ndb/dns: double Maxretries for long cname redirection chains 2017-04-01 03:35:30 +02:00
aiju 9cb67a523f nusb/serial: pl2303: better error handling 2017-03-31 20:20:25 +00:00
cinap_lenrek 330916bfa5 merge 2017-03-30 23:39:03 +02:00
cinap_lenrek 557cbe10ad sdnvme: enable in pcf, pccpuf, pc64 kernel configuration 2017-03-30 23:37:28 +02:00
cinap_lenrek 8cacd2cc0a sdnvme: don't write completion queue doorbell register when nothing has been processed
turns out on real hardware, the front falls off if we write
the completion queue doorbell registers without consuming
an entry. so only write the register when we have processed
something.
2017-03-30 23:33:46 +02:00
spew 0d3c3ba935 hjfs: disable hjfs check until more functionality is complete 2017-03-29 13:54:50 -05:00
spew 3525d2f7a7 hjfs: improve error messaging around blocks that are not found 2017-03-28 23:04:28 -05:00
spew 1c13d41b8c hjfs: Fix bugs in ref count scan check. Enable as a console command (caveat: command arguments will change as I implement more functionality) 2017-03-28 20:39:14 -05:00
cinap_lenrek e51044884b move blit roms to /sys/lib/blit 2017-03-29 01:33:16 +02:00
cinap_lenrek 5a36451a5e blit: fix mkfile 2017-03-29 01:20:13 +02:00
cinap_lenrek 0c1110ace2 kernel: fix twakeup()/timerdel() race condition
timerdel() did not make sure that the timer function
is not active (on another cpu). just acquiering the
Timer lock in the timer function only blocks the caller
of timerdel()/timeradd() but not the other way arround
(on a multiprocessor).

this changes the timer code to track activity of
the timer function, having timerdel() wait until
the timer has finished executing.
2017-03-29 00:30:53 +02:00
cinap_lenrek bfae9e08be sdnvme: NVMe controller driver (work in progress)
basic NVMe controller driver, reads and writes work.
"namespaces" show up as logical units.
uses pin/msi interrupts (no msi-x support yet).
one submission queue per cpu, shared completion queue.
no recovery from fatal controller errors.
only tested in qemu (no hardware available).

commiting this so it can be found by someone who has
hardware.
2017-03-29 00:21:35 +02:00
aiju 83dd98022d games/blit: mkfile: install into /bin/games 2017-03-28 19:48:50 +00:00
aiju 447672be5c add games/blit 2017-03-28 19:43:09 +00:00
spew f14e277c58 hjfs: fix broken dprint 2017-03-27 22:05:53 -05:00
spew 3103efb8b0 hjfs: simplify dprinting 2017-03-27 21:38:12 -05:00
spew 2e64925b91 hjfs: add simple scan check of directory entry blocks 2017-03-27 21:27:45 -05:00
spew e02bc28aaf hjfs: check: check a block if its ref count is _not_ zero. Also check all the ref counts of blocks of a directory and clean up messages 2017-03-27 17:57:10 -05:00
spew 3edac80327 hjfs: merge start of hjfs check implementation 2017-03-27 09:57:08 -05:00
spew 347bb2a7a7 hjfs: start implementation of checking a directory 2017-03-27 09:55:56 -05:00
cinap_lenrek f59ef5e8e7 devsd: handle case where theres no ifc->enable() function 2017-03-26 16:53:19 +02:00
cinap_lenrek 2b323158bd merge 2017-03-26 16:46:58 +02:00
cinap_lenrek 019bb580da devsd: check return value of ifc->enable(), don't leak unit name/user strings 2017-03-26 16:45:34 +02:00
cinap_lenrek 1889aa50c3 sdvirtio: return 1 for success in vioenable()/viodisable() 2017-03-26 16:43:32 +02:00
aiju cf8f90e1d3 file(1): recognise Xilinx bitstreams 2017-03-25 22:29:29 +00:00
spew b2b80a3da5 games/galaxy: fix exit race condition by pausing the galaxy before threadexitsall 2017-03-25 13:51:33 -05:00
spew 5aa501870b hjfs: Add comment to change the OFF size to 8 when given the chance 2017-03-25 13:49:13 -05:00
spew 85b8d253d4 games/galaxy: parallelize gravitational force calculations
Once the Barnes-Hut tree is constructed, the gravitational
force calculations can be done in parallel by dividing the
bodies up between a number of procs.
2017-03-25 13:05:47 -05:00
cinap_lenrek 4e8494aad7 pc kernel: handle PCMP and RSD being in low (kaddr) or reserved (vmap) memory
on thinkpad x1v4, the PCMP structure resides in upper reserved memory
pa=0xd7f49000 - while system memory ends at 0x0ffff000; so we have to
vmap() it instead of KADDR().

the RSD structure for ACPI might reside in low memory, so we sould
KADDR() in that case.
2017-03-25 04:08:14 +01:00
cinap_lenrek 152159a829 upas/smtp: fix cram-md5 auth, simplify doauth(), check varargs for dBprint()
- smtpcram() was replying with the challenge instead of the response... m(
- simplify doauth, use error string for auth_getuserpasswd() error logging
- enable #pragma varargck for dBprint()
2017-03-23 01:31:35 +01:00
cinap_lenrek 9b848903e6 upas/smtp: generate 128-bit random message id (was 32 bit), use dBprint(), cleanup unused variables 2017-03-23 00:36:57 +01:00
spew b7ee84c65d upas/smtp: Revert smtp dial string behavior to match that of old upas (thanks sam-d)
Also do some cleanup around buffers and memory management
2017-03-22 17:10:35 -05:00
spew 8b6621a360 [012568kqv]a: correctly lex full range of integers in the assemblers (thanks Ori_B)
The Plan 9 assemblers use strtoll to parse the integer literals
in their input. It turns out that this is almost correct, but
VLONG_MIN is clamped. This patch changes to use strtoull
in order to allow the full range of integers.
2017-03-22 00:04:24 -05:00
cinap_lenrek 3309f05b97 remove accidentally commited binary /sys/src/cmd/upas/fs/chkidx file (thanks mischief) 2017-03-21 20:31:15 +01:00
spew 8dd9f0e970 hjfs: Clear all refs to zero when reaming.
And a couple clarity/formatting changes
2017-03-21 14:07:18 -05:00
cinap_lenrek 1e2d95a803 ip/torrent: exit immidiately when file is complete after verification and not being in seed mode 2017-03-20 19:15:40 +01:00
cinap_lenrek b7c05975f5 ip/torrent: avoid peerid collision using truerand() instead of time(0) 2017-03-20 19:11:03 +01:00
cinap_lenrek c220100005 fortune: avoid buffer overflow for lines >= 2K, make sure index has at least one entry, use nrand()/ntruerand() for uniform distribution 2017-03-19 22:04:26 +01:00
cinap_lenrek da9b38c75c 5l,6l,8l,kl,ql,vl: allow duplicate GLOBAL symbols (from Ori Bernstein)
The plan 9 assemblers support the DUPOK flag on text symbols. They parse and
ignore it on GLOBL symbols. This patch makes it work in the linkers.

The reason I ran into this is because my programming language (Myrddin) uses
data symbols to generate type information, and it's useful to avoid
duplicating all of the type info in every file that gets generated.
2017-03-19 03:05:24 +01:00
cinap_lenrek 1a2aefcf11 devmouse: refactor screen blanking logic
devmouse controls the screen blanking timeout, so move the
code there avoiding cross calls between modules. the only
function that needs to be provided is blankscreen(), which
gets called with drawlock locked.

the blank timeout is set thru /dev/mousectl now, so kernels
without devvga can set it.

blanking now only happens while /dev/mouse is read. so this
avoids accidentally blanking the screen on cpu servers that
do not have a mouse to unblank it.
2017-03-18 16:58:27 +01:00
cinap_lenrek 08453422b1 games/doom: don't spawn midi process when opening /dev/audio failed (thanks qwx) 2017-03-17 01:02:01 +01:00
cinap_lenrek 1132d1b9df tapefs: handle more cpio formats (thanks qrstuv) 2017-03-17 00:45:48 +01:00
cinap_lenrek 3d052eb2ea upas/fs: tls sni support for pop3/imap 2017-03-16 22:06:31 +01:00
cinap_lenrek cb1dc365c2 upas/fs: fix memory leaks in tls code, handle tls in a common wraptls() function 2017-03-16 00:05:08 +01:00
cinap_lenrek efddf48500 upas/fs: getting rid of the fine-grain locking...
now that locking works, its time to get rid of it.
given that the only concurrency is between the periodic reader
process and the filesystem code, just make sure the filesystem
rpc handlers do not run concurrenty while syncing is in progress
with a single qlock.
2017-03-15 19:30:33 +01:00
cinap_lenrek c8d9390070 upas/fs: more cleanup... 2017-03-14 23:46:35 +01:00
cinap_lenrek 4b08ef2c55 upas/fs: remove more debugging crap 2017-03-14 23:31:10 +01:00
cinap_lenrek 75bca30647 upas/fs: remove unused segbrk memory allocator 2017-03-14 23:21:38 +01:00
cinap_lenrek 8417787f99 upas/fs: remove idx semaphore, cannot happen as symcmbox() always called with mailbox locked 2017-03-14 23:19:17 +01:00
cinap_lenrek 508b796b27 upas/fs: fix more locking bugs, remove debugging clutter, remove planb mbox code 2017-03-14 23:06:39 +01:00
cinap_lenrek 163dccbac0 upas/fs: make sure mbox is locked during msgdecref() in rclunk() 2017-03-14 19:32:20 +01:00
mischief d18440d992 gs: validate parameter is dict in .initialize_dsc_parse
gs bug 697190, upstream commit 875a0095

also check gs_alloc_struct return value from upstream commit a2afc66d
2017-03-14 00:48:50 -07:00
mischief 07a14612a1 gs: check for sufficient params in .sethalftone5
ghostscript bug 697203, upstream commit f5c7555c303
2017-03-13 18:12:17 -07:00
cinap_lenrek 9b2d3ed37a gs: fix dangleing pointer crash with "lock" (ghostscript Bug 697204) 2017-03-13 18:56:52 +01:00
spew 59ed389a6e games/galaxy: fix creation of new bodies
I accidentally deleted the line that sets the initial
position of the vector
2017-03-12 18:52:36 -05:00
spew 3f2d3721de games/galaxy: avoid unnecessary calculations
It is not necessary to recalculate the center of the
screen every time.
2017-03-12 18:33:54 -05:00
spew dff1e3813f games/galaxy: fix zoom
Zooming when far away from the center of gravity
of the galaxy would zoom the center of the screen
out of view. Now adjust the origin so that the
center of the screen stays centered
2017-03-12 18:24:45 -05:00
cinap_lenrek ffa430c570 upas/fs: lock mbox in syncallmboxes() to avoid assert crash 2017-03-12 21:29:28 +01:00
cinap_lenrek b24ebff76a upas/fs: remove useless syncsem, make sure mbox is locked when fetching / syncing 2017-03-12 21:23:21 +01:00
cinap_lenrek f616c63b39 imap4d: simplify auth with encodefmt (backport from 9front) 2017-03-12 18:50:27 +01:00
aiju 8b6804717b nupas: delete okcidr(); always trust spf records 2017-03-12 17:19:20 +00:00
cinap_lenrek dff78ef64a merge 2017-03-12 17:20:13 +01:00
cinap_lenrek 963cfc9a6f merging erik quanstros nupas 2017-03-12 17:15:03 +01:00
cinap_lenrek 5b7a62e5e6 merge 2017-03-11 20:42:25 +01:00
cinap_lenrek 8177d20fb2 kernel: get rid of active.Lock and active.thunderbirdsargo 2017-03-11 16:30:51 +01:00
cinap_lenrek a7f8ebca2f pc kernel: give cpu servers as many image cache strctures as processes 2017-03-11 16:28:11 +01:00
cinap_lenrek 5104934135 pc kernel: avoid AP's spinning in syncclock(), don't wait for thunderbirdsargo 2017-03-11 16:24:56 +01:00
cinap_lenrek 812383473c pc kernel: assume tsc and lapic clock rate on application processors is the same as on bootrap processor 2017-03-11 16:18:01 +01:00
cinap_lenrek 3e0e77a852 pc kernel: don't use active.thunderbirdsargo in vunmap() tlb flush code 2017-03-11 16:13:58 +01:00
cinap_lenrek cb5f6005bc teg2: fix format string warning in mmu.c 2017-03-11 16:07:48 +01:00
spew 2c6c64c474 games/galaxy: simplify zoom loop 2017-03-10 10:37:12 -06:00
spew acd1a3edda games/galaxy: new mouse behavior
MB1 moves the galaxy. MB2 zooms the galaxy. New body creation
moved to the menu
2017-03-10 09:57:23 -06:00
cinap_lenrek 5fc5c18208 cwfs: handle DMTMP flag in create 2017-03-06 03:07:03 +01:00
spew 0e9973c80f games/galaxy: Change button 2 to reposition the galaxy, remove "move" from the button 3 menu 2017-03-01 15:59:26 -06:00
mischief a4895f5e44 pc64: enable cputemp driver
works on on x301 and t420.
2017-03-01 02:43:51 -08:00
mischief 319a9cc905 pc, pc64: bump Qmax in devarch
my x301 and t420 run out of archfiles with *acpi= while trying to add
hdacmd from audiohda.
2017-03-01 02:43:14 -08:00
spew 0ab5d34be4 games/galaxy: tweak pausing behavior 2017-02-27 19:56:46 -06:00
cinap_lenrek 9ce9299d17 games/doom: ... but keep fd=2 open :) 2017-02-27 00:01:39 +01:00
cinap_lenrek 6064e1b6fb games/doom: avoid /dev/cursor fd leak into music process 2017-02-27 00:00:58 +01:00
cinap_lenrek 394af5a216 authsrv: handle short reads in initkeyseed() 2017-02-26 23:10:17 +01:00
cinap_lenrek 6de804b578 authsrv: don't hash in hostowner key for keyseed
aiju → i don't like it, it's more bullshit ways to expose the key :)
aiju → if someone can grab /adm/keyseed, they can also grab /adm/users and /adm/keys
2017-02-26 22:44:47 +01:00
cinap_lenrek 8834003afa games/doom: music support (thanks qu7uux) 2017-02-26 22:14:10 +01:00
cinap_lenrek 577de86669 midi: ignore bends, allow piping from stdin and to stdout, write in chunks from within sample loop (thanks qu7uux) 2017-02-26 19:30:48 +01:00
cinap_lenrek 70c6dab003 play, file: recognize midi and mus audio 2017-02-26 19:26:42 +01:00
cinap_lenrek 297bf25f61 add games/mus midi converter (by qu7uux) 2017-02-26 19:23:52 +01:00
cinap_lenrek 009bec0752 authsrv: salt the keyseed from /adm/keyseed file
change the keyseed key derivation to hkdf sha256
using the hostowners des key plus 256 bit random
salt from /adm/keyseed.
2017-02-26 03:47:46 +01:00
cinap_lenrek 27498dd63a authsrv: fix mkkey() dummy key generation (thanks aiju) 2017-02-26 02:21:49 +01:00
cinap_lenrek 27485e62d1 authsrv: get rid of needreply parameter by changing vnc protocol handler 2017-02-26 01:34:42 +01:00
aiju 6651be7516 authsrv: more useful error reporting 2017-02-26 01:11:37 +01:00
cinap_lenrek 28491941b0 auth/asaudit: quote user and dom attributes in factotum key 2017-02-25 17:47:36 +01:00
aiju e4dc3f9bd8 asaudit: check factotum key ; netaudit: mention asaudit 2017-02-25 11:54:15 +01:00
cinap_lenrek 58b6cdfdeb merge 2017-02-24 01:33:32 +01:00
cinap_lenrek c52251c9b6 libaml: make heap size field int, implement BankField definitions 2017-02-24 01:31:58 +01:00
aiju 0406d9828a asaudit: missing \n in print 2017-02-24 01:08:08 +01:00
aiju e14690517e merge 2017-02-24 01:02:43 +01:00
aiju 1645f3314c add auth/asaudit 2017-02-24 00:54:40 +01:00
cinap_lenrek c22fa6d5eb auth/readnvram: also print dp9ik key 2017-02-24 00:10:36 +01:00
aiju 54ec7aed62 auth/keyfs: support -r flag to mount read-only 2017-02-23 23:22:49 +01:00
cinap_lenrek 04171d2477 ether8169: add support for RTL8106E (thanks _potato) 2017-02-21 21:53:10 +01:00
cinap_lenrek a32d11dff3 ether82563: work arround phyprobe() failing on 82579LM without cable plugged in (thanks mischief)
on 82579LM, the phy status is inaccessible without
a cable plugged, so we wait and retry phyprobe() once
the link status changes.
2017-02-20 22:01:54 +01:00
aiju 55373a6498 ip/ipconfig: don't null terminate the dhcp string options.
this seems to be an anachronism; few modern clients put the null in and RFC 2132 says clients 'SHOULD NOT' null terminate
2017-02-19 22:53:10 +00:00
cinap_lenrek 02a26802ff merge 2017-02-19 18:22:14 +01:00
cinap_lenrek 52570a2a2d ether82563: support for i219 (tested on t460p, thanks aiju) 2017-02-19 18:20:46 +01:00
spew 63870e3ef4 games/galaxy: fix crash on write to closed display 2017-02-19 10:02:56 -06:00
cinap_lenrek abda59c7ec ip/gping: fix corruption due to Machine.last pointer not being maintained in pingclean(), cleanup unused stuff 2017-02-19 02:27:42 +01:00
cinap_lenrek 59ba35a327 libregexp: fix assert check for compile1 instruction count
the assert fails for regcompnl(".") as TANY is compiled to
one instruction instead of two when nl == 0.

its not a problem when we end up with less instructions, so
changing the assert condition from == to <= to make sure we
didnt overrun the buffer.

--
cinap
2017-02-19 00:32:47 +01:00
spew 5aabf85d7c games/galaxy: add n-body simulator 2017-02-18 09:08:51 -06:00
spew 412b7501e4 games/mix: remove unused variable 2017-02-18 09:07:46 -06:00
cinap_lenrek 064a987bd8 wpa: dont send initial "start" message, faster polling interval waiting for connection
the kernel will automatically timeout the eap blocked state
for us and reassociate for us, so there is no need to provoke
the ap to start the wpa/eap handshake.

make the polling faster changing the sleep time from 500 to
100 ms.
2017-02-16 20:11:20 +01:00
cinap_lenrek 3ea0572f4f wifi: timestamps in debug print, flush queue on deassoc, shorter roam timeout, timeout in blocked state, fix essid seprint race
- add some milisecond timestamps to the status change debug printing
- flush the packets in the queue on deassoc to avoid processing old pae
  packets on next association.
- make roaming timeout shorter (60 -> 20 seconds)
- automatically timeout and restart wpa/pae blocked state
- fix printing race when essid gets changed underneath seprint
2017-02-16 20:08:27 +01:00
cinap_lenrek c1c644d13c etheriwl: add support for Centrino Advanced-N 6030, 6235 (thanks khm, openbsd)
from openbsd driver, it seems the Centrino Advanced-N 6030 and 6235
cards share the same device revision as the 6205 (Type6005). Also
changing the device revision field from 4 to 5 bits.
2017-02-16 20:03:41 +01:00
cinap_lenrek b61799df43 playlistfs: fix playc chan type (thanks mischief) 2017-02-15 08:53:31 +01:00
cinap_lenrek f2d2f9374b jukefs: fix realloc sizes (thanks mischief) 2017-02-15 08:50:03 +01:00
cinap_lenrek 60cbbb123b merge 2017-02-13 22:28:35 +01:00
cinap_lenrek 45d01d9c99 wifi: handle short preamble and short time slot capabilities
- drivers enable short preamble and sort timeslot depending
  on the ap beacon capinfo field (bss->cap)
- wifi sets short preamble bit in capinfo on association request
- wifi sets short timeslot bit when ap advertized it in beacon
2017-02-13 22:26:38 +01:00
aiju d9a964788b games/gb: fix bug that prevented timer data from being accessed (thanks qwx) 2017-02-12 12:28:02 +01:00
aiju fe1e95d6d8 games/gb: timer array should be unsigned (thanks qwx) 2017-02-12 00:38:17 +01:00
aiju 6176b55759 games/gb: fix typo in the routine to load timer data (thanks qwx) 2017-02-11 23:52:35 +01:00
cinap_lenrek 6840a9aafd libsec: zero name buffer in X509toECpub() 2017-02-10 21:42:11 +01:00
cinap_lenrek fb2abc2a04 libsec: make X509toECpub() return CN name like X509toRSApub() 2017-02-10 21:36:19 +01:00
cinap_lenrek 24007b9120 libsec: revert asn1mpint(), rewrite rsa signature validation, cleanups
reverting asn1mpint() as all users really just expect
unsigned integers here. also openssl seems to interpret
rsa modulus as unsigned no matter what... so keeping
it as it was before.

handle nil cipher bytes in factotum_rsa_decrypt() due
to pkcs1padbuf() failing.

apply some lessions from intels berzerk paper:

instead of parsing the decrypted digest info blob, we
generate the *expected* blob's for all digest algorithms
that match the digest size and compare the results.

provide pkcs1 pad and unpad functions that consistently
enforce minimum padding size and handles block types 1
and 2.
2017-02-10 00:08:38 +01:00
mischief e8045cbcbf factotum: support sha256 algorithm in rsa pkcs#1 signing
also removed md2 oid, it is unused.
2017-02-09 09:08:43 +00:00
cinap_lenrek 6386a0391a libsec: handle signed asn.1 bigint to mpint conversion for x509 2017-02-06 21:40:42 +01:00
cinap_lenrek 486523bbc5 ip/ipconfig: have to refresh /net/cs, /net/dns after ndbconfig even tho /net/ndb didnt got written 2017-02-06 11:19:45 +01:00
cinap_lenrek bbce9c0566 rsagen: prefer 65537 as the default exponent when elen == 0, otherwise pick randomly 2017-02-06 04:25:38 +01:00
cinap_lenrek 5256f4063e libsec: fix mkbigint(), asn.1 uses two's compement signed representation
quick fix is to bias the rounding so the msb will always
be zero. should write proper conversion code to actually
deal with signed mpints... also for asn1mpint()... -- cinap
2017-02-06 03:50:03 +01:00
cinap_lenrek 02b3c609ed libsec: check if modulus is too small for message in pkcs1padbuf() 2017-02-06 02:03:16 +01:00
cinap_lenrek 1df513a2a1 libsec: need PKCS#9 "Extension Request" attribute (rsareq()) 2017-02-06 01:01:34 +01:00
cinap_lenrek 03e6d3a0f0 aan: remove fcallfmt 2017-02-05 06:14:42 +01:00
cinap_lenrek b8811b7a2f merge 2017-02-05 05:16:39 +01:00
cinap_lenrek 00575e07bb libsec: have rsagen() always produce postive !dk to avoid confusion 2017-02-05 05:15:17 +01:00
cinap_lenrek 541528252e merge 2017-02-05 02:50:11 +01:00
cinap_lenrek 96769e0476 libmp: fix mpmod() aliasing bug when n == r and x < 0 (thanks aiju, mischief)
mischief found this in rsafill()'s call mpmod(c2, x, x), where
d parameter is negative (rsagen created a rsa key with negative dk).
2017-02-05 02:48:13 +01:00
spew 3b24eb4c1f games/mix: implement Knuth's specification for comments 2017-02-03 18:55:02 -06:00
cinap_lenrek 7f12431009 aan: use unsigned message counters, reject repeated acks, cleanup debug prints 2017-02-04 01:39:36 +01:00
spew 930be3d317 libregexp: improve the transition to next available thread, instruction, and generation 2017-02-03 15:33:15 -06:00
spew 9ae083d816 libregexp: simplify regular expression vm implementation
Make the logic around who has priority over the final
match simpler by merging the priority generation and
match fields in a smarter way. Move the creation of
new thread matches up to the top to avoid jumping all
over the place.
2017-02-02 21:21:34 -06:00
cinap_lenrek f94167ebee ip/ipconfig: don't write /net/ndb when getting config from ndb (-N) 2017-02-02 22:00:51 +01:00
cinap_lenrek 65337bec22 aan: check negative message size in header 2017-02-02 20:53:05 +01:00
cinap_lenrek 7516e85813 audio/flacdec: continue after decode error (thanks deuteron) 2017-02-01 10:38:19 +01:00
cinap_lenrek d643cf2fe6 cwfs: handle worm exhaustion more gracefully
don't deadlock when cwgrow() detects we'r out of worm space
by releasing the cache superblock buffer.

don't allocate space beyond the worm device when dumping by
having slit() check. after cwrecur(), we check if there are
enougth blocks remaining to write the dump date directories
and superblocks.
2017-01-30 23:17:18 +01:00
cinap_lenrek 5171a0ac52 cwfs: fix cwcmd startdump 2017-01-27 02:00:20 +01:00
cinap_lenrek c6b2ad583e auth/keyfs: use ulong for time 2017-01-26 22:09:44 +01:00
cinap_lenrek 8ea917d119 secstore/secuser: use ulong for time 2017-01-26 22:06:57 +01:00
spew acd4a952bd games/mix: fix STZ bug, print CMPA instruction 2017-01-23 13:41:21 -06:00
cinap_lenrek 9278b94623 pc/pc64: get rid of timerset(0) case, was used with "i8253set off" ctl 2017-01-22 21:12:38 +01:00
cinap_lenrek 885d41dd7b sgi: get rid of timerset(0) case 2017-01-22 21:08:28 +01:00
cinap_lenrek 6cb359cc00 sgi: cleanup timer code
- no need to splhi() in timerset, always called with
  interrupts off.

- make timerset always update the period (next == 0)

- remove period update in fastticks(), simplify
  delta calculation.
2017-01-22 20:39:14 +01:00
cinap_lenrek a2eafd2cb0 merge 2017-01-22 00:43:44 +01:00
cinap_lenrek d6bb01da76 factotum: fix memory leak in findkey() 2017-01-22 00:42:13 +01:00
spew 339fda9164 games/mix: remove tests directory 2017-01-17 20:52:49 -06:00
spew 4b68ddfb5a games/mix: document -g option, rename tests to examples as it is in the man page 2017-01-17 20:51:08 -06:00
cinap_lenrek e9bf14eceb libsec: avoid temp variables in chacha/salsa ENCRYPT() macro
given that we only pass uchar* with constant offsets
to the s and d arguments of ENCRYPT(), we do not need
the temporary variables sp/dp and the compiler is
smart enougth to combine the const offset with the ones
from GET4() and PUT4() and emit single load and store
instructions for the byte accesses.
2017-01-15 04:09:47 +01:00
cinap_lenrek 03c44c44b0 rx: remove ssh code 2017-01-13 19:54:42 +01:00
khm dc8c7bf2b7 ssh: R.I.P. 2017-01-12 16:36:38 -08:00
cinap_lenrek cb1555c7d7 sgi: change definition of tas() to take void* like the rest 2017-01-12 21:11:34 +01:00
cinap_lenrek bdc1b187c4 merge 2017-01-12 20:17:52 +01:00
cinap_lenrek 2e23780d2f libsec: implement extended 192-bit nonce xchacha variant and hchacha function 2017-01-12 20:16:38 +01:00
cinap_lenrek 47f07b2669 kernel: make the mntcache robust against fileserver like fossil that do not change the qid.vers on wstat
introducing new ctrunc() function that invalidates any caches
for the passed in chan, invoked when handling wstat with a
specified file length or on file creation/truncation.

test program to reproduce the problem:

#include <u.h>
#include <libc.h>
#include <libsec.h>

void
main(int argc, char *argv[])
{
	int fd;
	Dir *d, nd;

	fd = create("xxx", ORDWR, 0666);
	write(fd, "1234", 4);
	d = dirstat("xxx");
	assert(d->length == 4);
	nulldir(&nd);
	nd.length = 0;
	dirwstat("xxx", &nd);
	d = dirstat("xxx");
	assert(d->length == 0);
	fd = open("xxx", OREAD);
	assert(read(fd, (void*)&d, 4) == 0);
}
2017-01-12 20:13:20 +01:00
cinap_lenrek 4aeefba681 kernel: add "close" ctl message for tcp connection to gracefully hang up a connection without a tcp reset (used by go) 2017-01-12 20:04:41 +01:00
spew a0cc369c15 games/mix: Add Knuth MIX emulator/assembler 2017-01-10 11:42:11 -06:00
cinap_lenrek c67d0c699f 6c: reverse register allocation order to avoid having to spill AX,DX and CX
allocating AX,CX,DX last improves 64-bit multiplication-add
chains like a*b + c*d as the multiplication does not need to save
and restore AX and DX registers in most cases. reserving CX for
shifts also helps.
2017-01-08 17:41:10 +01:00
cinap_lenrek 28089ee035 aux/data2s: compress output
encode printable characters litteraly, use D() macro to
reduce DATA instruction overhead.

this halves the time spend assembling $CONF.root.s for
the kernel build.
2017-01-07 20:36:13 +01:00
cinap_lenrek df6c190831 cfs: fix cfsctl interaction with mount cache (mount -C flag)
the root fileserver is mounted with the mount cache enabled
causing the contents of the cfsctl file to be cached as well
leading to wrong results. so after we generated the new stat
buffer, we increment the qid.vers so the cache starts out
clean.
2017-01-06 02:54:26 +01:00
cinap_lenrek 19dc7c2097 6c, 8c: fix "DI botch" evacuating DI/SI/CX registers to ".save" variables 2017-01-02 05:49:18 +01:00