Commit graph

4589 commits

Author SHA1 Message Date
cinap_lenrek 079d3f4002 libsec/ecc: fix memory leak (free() vs mpfree()) 2015-06-07 22:12:46 +02:00
cinap_lenrek 4be3300e98 prep(8): edisk also adds a EFI system partition (esp) when not already exists. 2015-06-06 02:13:01 +02:00
cinap_lenrek 628611fb5c inst: provide gpt/mbr choice when disk is blank, format esp 2015-06-06 02:00:51 +02:00
cinap_lenrek 1613fd9f52 disk/edisk: create esp partition in addition to plan9 partition in auto mode 2015-06-05 21:57:08 +02:00
cinap_lenrek bbc35cc01b 9boot: look for plan9.ini in all filesystems accessible to efi to find plan9 partition
try the handle buffer in reverse order looking for plan9.ini
to find plan9 partition (9fat). when that fails, we'll default
to the first handle which should be the esp.
2015-06-05 05:09:22 +02:00
mischief 045530aed2 ape: define long long limits 2015-06-04 17:16:23 -07:00
cinap_lenrek 16b3a688c3 dossrv: maintain file creation date/time on disk, fsinfo sector can be 0 (disabled) 2015-06-04 04:34:08 +02:00
cinap_lenrek e83ef3d1e2 disk/format: create Fatinfo sector for fat32 2015-06-04 03:58:03 +02:00
cinap_lenrek 137a762eca disk/edisk: fix blank mode
there where two problems with blank (-b flag):

we did not update the backup header when there was already a valid
backup header in place. we always want to initialize a new backup header
in blank mode!

we now also check the backup header matches the primary (or the other
way arround depending on which header could be read), reporting any
mismatches and restoring the backup from the data of the primary.

the protective mbr needs to start at sector 1 not 0 (apparently, this
matters for ovmf).
2015-06-03 23:19:13 +02:00
cinap_lenrek 1a1863e5dc rc-httpd: cleanup cgi handler
- avoid silly stats and checks for $cgi_dir, just use status
  from builtin cd.

- log proper http status code from the cgi script
2015-06-02 16:56:19 +02:00
cinap_lenrek 8caf4d3bcb authsrv: use plan9 key for http authentication
in addition to /sys/lib/httppasswords, allow http authentication
to use the plan9 password, which can be changed by the user.
2015-06-02 01:15:43 +02:00
cinap_lenrek 0afac04530 hgweb.cgi: +x 2015-06-02 23:44:39 +02:00
cinap_lenrek cfd0698dbd hgweb.cgi: take REPO_ROOT and REPO_NAME from env, so can be used out of the box 2015-06-02 23:41:16 +02:00
cinap_lenrek 7b8bada6b4 rc-httpd: various fixes
care has to be taken when splitting the host into SERVER_NAME and SERVER_PORT,
as ipv6 uses : in the host part. also do it consistently, the host can be set
thru the request uri and the host header.

set REMOTE_USER to empty string to prevent accidents.

we do not handle chunked transfer encoding, just assuming the client doesnt
do keep alive is wrong. we have to reject the post when the client tries
chunked post with 411 "Length required" error.
2015-06-02 23:15:02 +02:00
cinap_lenrek 5c6357de8b devtls: ignore UnrecogniedName (112) alert message (for SNI) 2015-06-01 01:32:57 +02:00
cinap_lenrek 0ca9977075 9fs: handle all the dos filesystems in one case, add esp handler 2015-05-31 19:48:44 +02:00
cinap_lenrek 42484b6ef2 disk/fdisk: learn about EFI system partition (type 0xEF), honor protective mbr (type 0xEE)
efi systems may use traditional dos partition table
with an esp (efi system partition). otherwise, honor
the protective mbr partition (0xEE) and exit when we
encounter it.
2015-05-31 19:30:38 +02:00
cinap_lenrek 52c6b751c0 inst/bootplan9: skip mbr installation and active partition switching when we have no plan9 dos partition
on efi systems, there is no plan9 partition in the dos partition table
that could be marked active and the mbr should be left alone.
2015-05-31 16:41:46 +02:00
cinap_lenrek 8278f6e34c prep(8): document disk/edisk 2015-05-31 14:15:49 +02:00
cinap_lenrek 82aa1d5c78 integrate disk/edisk with diskparts, bootfs and installer (gpt support) 2015-05-31 13:06:18 +02:00
cinap_lenrek 3e124e1f13 libdisk: error handling, sanity checks
- make sure disk file is an actual file and not a directory, log or empty file
- sanity check: file has to be at least one sector to be a disk
- simplify error handling using freedisk()
2015-05-31 12:58:13 +02:00
cinap_lenrek ce76af64fe disk/edisk: little improvements
- make UU() shorter by using long long constant to encode node field
- store Flag as a mask, not as a shift count
- put the attributes before the name in cmdsum() as it is fixed length
2015-05-31 11:19:22 +02:00
cinap_lenrek c770b09f43 test: use libc.h constants for access() mode (thanks qrstuv) 2015-05-31 09:37:59 +02:00
cinap_lenrek 460c598430 io.h: fis comment PciSID (alphapc, kw, mtx, teg2) (thanks qeed!) 2015-05-30 16:50:02 +02:00
cinap_lenrek b137420eff pc/io.h: fix comment for PciSID 2015-05-30 16:45:02 +02:00
cinap_lenrek 1376d559ed disk/edisk: fix usage (was disk/gdisk) 2015-05-30 03:36:58 +02:00
cinap_lenrek 4a4575bd4e disk/edisk: gpt partition table editor (no manpage, work in progress) 2015-05-30 03:22:08 +02:00
cinap_lenrek 09b6a92145 disk/partfs: adding identical partition is no-op 2015-05-30 22:37:46 +02:00
cinap_lenrek b5cbd0bebd disk/fdisk: fix help text 2015-05-30 22:26:18 +02:00
cinap_lenrek 3ceedfd1e1 nusb/disk: adding identical partition is a no-op 2015-05-30 22:24:55 +02:00
cinap_lenrek de3c058efb cputime(2): fix prototype for cycles() (thanks qrstuv) 2015-05-28 18:11:45 +02:00
cinap_lenrek e333a07ded tcs: fix swaped alias mapping gb <-> gb2312 2015-05-28 16:39:04 +02:00
cinap_lenrek 3d1e12363d uhtml: check if document is valid utf8 even with charset specified
often, documents specify charsets but are really utf-8 encoded.
we now try to decode as utf-8 and only if that fails assume
the charset specified in the document.
2015-05-28 16:37:55 +02:00
cinap_lenrek e601e1605b libsec: cleanup x509 and tlshand
- add overflow checks for newbytes(), newbits(), newints()
- remove suspicious nil check from estrdup()
- remove useless nil checks before free
2015-05-28 00:31:36 +02:00
cinap_lenrek 16bbaa2014 ape: include <sys/types.h> in <sys/wait.h> for pid_t (thanks jens staal) 2015-05-27 21:48:42 +02:00
cinap_lenrek a788f2000d libsec/x509: fix verify_signature(), digest_certinfo(), X509dump()
make digest_certinfo() return the digest length, otherwise
return -1 as an error and handle it in the callers.

pass expected digest length to verify_signature() and
check digest length from certificate! make sure we wont
run off the buffer.

fix newlines in error prints of X509dump().
2015-05-27 19:52:06 +02:00
cinap_lenrek 5f7d769a02 libsec/x509: use SHA2-256 digest algorithm instead of MD5
this implements SHA2 (224, 256, 384, 512) signature algorithms and
uses sha256WithRSAEncryption for X509req() and X509gen() instead
of oid_md5WithRSAEncryption.
2015-05-27 18:35:37 +02:00
cinap_lenrek 5ef922959a pci: map pci bars for devices with base class codes (ccrb) 0x00 and 0x0D-0x11 (thanks qeed)
there are a few more device base class codes defined 0x0D-0x11, and
qemu appears to use base class code 0x00 for some of its fake
devices.
2015-05-27 00:23:13 +02:00
cinap_lenrek d6a91e0ae4 cc: set unspecified elements to zero in local variable initializers
the compiler used to skip zero initialization when initializer
list was given not covering unspecified elements. now we zero
all non explicitely initialized elements. for example:

typedef struct F F;
struct F
{
	int a;
	int b;
	int c;
};

void
main(void)
{
	char a[16] = { 1, 2, 3 };	/* a[3..15] initialized to zero */
	F f = { .b = 1 };			/* f.a, f.c initialized to zero */
}
2015-05-26 19:25:06 +02:00
stanley lieber cfafa67640 rootstub: do not create pkg directories 2015-05-25 15:04:30 -04:00
stanley lieber 0853e2cc3b remove pkg(1): we regret the error 2015-05-25 15:03:44 -04:00
cinap_lenrek ff2e8f308d thread(2): fix prototype for threadint() and threadkillgrp() (thanks qwx!) 2015-05-25 13:03:45 +02:00
cinap_lenrek 0d87019a9b cc: handle unaligned data in = {0} local initializer
the emited code that initializes local variables did not handle
unaligned data causing stack corruption, affecting code like:

void main(void)
{
	char a[9] = {0};
}

this change will emit code that does byte stores for the unaligned
bytes and also handles small objects (<= 16 bytes) without branches.
2015-05-25 01:57:18 +02:00
mischief c727d2ae8a cdproto: /sys/log/httpd should be a directory 2015-05-20 18:25:53 -07:00
mischief a94a8a06de revert httpd log file goof 2015-05-20 18:16:54 -07:00
cinap_lenrek 890c459567 webfs: send servername in tls client hello (SNI) 2015-05-21 02:28:06 +02:00
cinap_lenrek 40360a992d libsec: implement tlsClient support for RFC6066 server name identification (SNI)
tlsClient() now can optionally send the server_name in the ClientHello
message by setting the TLSconn.serverName. This is required for some
https sites.
2015-05-21 02:26:57 +02:00
mischief a1bbf39c34 ip/httpd: fix syslog file 2015-05-20 15:38:56 -07:00
mischief 5d2253af99 libhttpd: declare hvprint 2015-05-20 15:09:34 -07:00
cinap_lenrek d8487e98c6 etherigbe: spi eeprom support (thanks echoline) 2015-05-20 09:49:27 +02:00