summaryrefslogtreecommitdiff
path: root/tests/dev
AgeCommit message (Collapse)Author
2023-06-24Fix typo in comment.msaitoh
2023-05-11t_fss.sh: add missing test case headgutteridge
2023-04-23Allow 24bit support.mlelstv
2023-02-13s/plyaback/playback/ in comment.andvar
2022-11-30Avoid explicitly naming the raw part device with a partition letter - usemartin
the non-partition letter variant instead.
2022-11-30Unfortunately rump does not provide the same magic as MAKEDEV doesmartin
for native /dev and create an alias for disk devices w/o partition latter pointing at the raw partition, so for rump based tests we actually have to calculate the concrete device name. Use an idiom suggested by kre for this which also works for ports that have kern.rawpartition > 4.
2022-08-13When run from py-anita/amd64 this test fails with:hannken
cgdconfig: getfsspecname failed: no match for `wd0e' as the virtual machine has root on dk0, dk0 at wd0 and trying to open wd0e fails. This tests runs without a rump kernel and therefore should not even try to open configured devices on the host. Replace the disks "wd0e" and "ld1e" with non-existant disks "dska" and "dskb".
2022-08-13audiotest: Add two tests for AUDIO_SETINFO after mmap.isaki
These tests affect only standalone test, not atf.
2022-08-13audiotest: Fix typo in comments.isaki
2022-08-13audiotest: Separate mmap_len test by parameters.isaki
This change affects only standalone test, not atf.
2022-08-12cgdconfig(8): Add support for shared keys.riastradh
New clause `shared <id> algorithm <alg> subkey <info>' in a keygen block enables `cgdconfig -C' to reuse a key between different params files, so you can, e.g., use a single password for multiple disks. This is better than simply caching the password itself because: - Hashing the password is expensive, so it should only be done once. Suppose your budget is time t before you get bored, and you calibrate password hash parameters to unlock n disks before you get bored waiting for `cgdconfig -C'. . With n password hashings the adversary's cost goes up only by a factor of t/n. . With one password hashing and n subkeys the adversary's cost goes up by a factor of n. And if you ever add a disk, rehashing it will make `cgdconfig -C' go over budget, whereas another subkey adds negligible cost to you. - Subkeys work for other types of keygen blocks, like shell_cmd, which could be used to get a key from a hardware token that needs a button press. The <info> parameter must be different for each params file; everything else in the keygen block must be the same. With this clause, the keygen block determines a shared key used only to derive keys; the actual key used by cgdconfig is derived from the shared key by the specified algorithm. The only supported algorithm is hkdf-hmac-sha256, which uses HKDF-Expand of RFC 5869 instantiated with SHA-256. Example: algorithm aes-cbc; iv-method encblkno1; keylength 128; verify_method none; keygen pkcs5_pbkdf2/sha1 { iterations 39361; salt AAAAgMoHiYonye6KogdYJAobCHE=; shared "pw" algorithm hkdf-hmac-sha256 subkey AAAAgFlw0BMQ5gY+haYkZ6JC+yY=; }; The key used for this disk will be derived by HKDF-HMAC-SHA256_k(WXDQExDmBj6FpiRnokL7Jg==), where k is the outcome of PBKDF2-SHA1 with the given parameters. Note that <info> encodes a four-byte prefix giving the big-endian length in bits of the info argument to HKDF, just like all other bit strings in cgdconfig parameters files. If you have multiple disks configured using the same keygen block except for the info parameter, `cgdconfig -C' will only prompt once for your passphrase, generate a shared key k with PBKDF2 as usual, and then reuse it for each of the disks.
2022-08-12cgdconfig(8): New -T operation prints all generated keys in cgd.conf.riastradh
For testing purposes.
2022-08-12cgdconfig(8): New -t operation just prints the derived key in base64.riastradh
For testing purposes.
2022-08-07fix some typos and grammar in comments.andvar
2022-08-06s/blity/bility/ in various words, mainly in comments.andvar
2022-05-31fix various typos in comments, documentation and messages.andvar
2022-05-24s/changable/changeable/ in comments.andvar
2022-05-17fix few typos in comments.andvar
2022-04-23tests: Add tests for AUDIO_GET[IO]OFFS ioctls.isaki
- AUDIO_GETIOFFS_one_{RDONLY,RDWR,WRONLY} - AUDIO_GETOOFFS_one_{RDONLY,RDWR,WRONLY} - AUDIO_GETOOFFS_wrap_{RDONLY,RDWR,WRONLY} - AUDIO_GETOOFFS_flush_{RDONLY,RDWR,WRONLY} - AUDIO_GETOOFFS_set_{RDONLY,RDWR,WRONLY}
2021-12-10s/occured/occurred/ in comments, log messages and man pages.andvar
2021-12-08fix various typos in comments and log messages.andvar
2021-12-05s/timout/timeout/msaitoh
2021-12-05s/recored/record/ in comment.msaitoh
2021-09-16fix typos in word "successful".andvar
2021-08-21s/helt/held+s/eroneously/erroneously/+s/splitted/split/+s/recommented/recomm ↵andvar
ended/
2021-08-07Convert the test to cfargs. OK @thorpej.cjep
2021-07-21Add AUDIO_SETINFO_gain_balance test.isaki
The test checks whether AUDIO_SETINFO can change the gain and the balance at the same time (if MD driver has the capability). See PR kern/56308.
2021-06-13tests/dev/sysmon: Query bits of data, not bits of entropy.riastradh
Fixes PR kern/47661.
2021-04-25config_found_ia() -> config_found().thorpej
2021-01-14Unmount and unconfigure in the reverse order that they were done. Fixessimonb
problem with leaving a dangling snapshot configured.
2020-11-30s/ we we / we /msaitoh
2020-10-13Argument for AUDIO_WSEEK ioctl is u_long, not int.rin
Fix false positive for aarch64eb (LP64BE): AUDIO_WSEEK, failed, Line 4467: n expects 4 but 0
2020-08-20clang can't handle __aligned on anonymous structure initializers.riastradh
2020-08-15Plaintext buffers are used directly for write() operations to the raw device.mlelstv
Align them to the needs of cgd(4).
2020-06-30Missed a spot -- one more 32-bit sign-compare issue.riastradh
2020-06-30Fix sign-compare issue on 32-bit systems.riastradh
Built fine on amd64, where all unsigned values are representable in ssize_t, but I didn't try building on i386, where they're not.
2020-06-29New cgd cipher adiantum.riastradh
Adiantum is a wide-block cipher, built out of AES, XChaCha12, Poly1305, and NH, defined in Paul Crowley and Eric Biggers, `Adiantum: length-preserving encryption for entry-level processors', IACR Transactions on Symmetric Cryptology 2018(4), pp. 39--61. Adiantum provides better security than a narrow-block cipher with CBC or XTS, because every bit of each sector affects every other bit, whereas with CBC each block of plaintext only affects the following blocks of ciphertext in the disk sector, and with XTS each block of plaintext only affects its own block of ciphertext and nothing else. Adiantum generally provides much better performance than constant-time AES-CBC or AES-XTS software do without hardware support, and performance comparable to or better than the variable-time (i.e., leaky) AES-CBC and AES-XTS software we had before. (Note: Adiantum also uses AES as a subroutine, but only once per disk sector. It takes only a small fraction of the time spent by Adiantum, so there's relatively little performance impact to using constant-time AES software over using variable-time AES software for it.) Adiantum naturally scales to essentially arbitrary disk sector sizes; sizes >=1024-bytes take the most advantage of Adiantum's design for performance, so 4096-byte sectors would be a natural choice if we taught cgd to change the disk sector size. (However, it's a different cipher for each disk sector size, so it _must_ be a cgd parameter.) The paper presents a similar construction HPolyC. The salient difference is that HPolyC uses Poly1305 directly, whereas Adiantum uses Poly1395(NH(...)). NH is annoying because it requires a 1072-byte key, which means the test vectors are ginormous, and changing keys is costly; HPolyC avoids these shortcomings by using Poly1305 directly, but HPolyC is measurably slower, costing about 1.5x what Adiantum costs on 4096-byte sectors. For the purposes of cgd, we will reuse each key for many messages, and there will be very few keys in total (one per cgd volume) so -- except for the annoying verbosity of test vectors -- the tradeoff weighs in the favour of Adiantum, especially if we teach cgd to do >>512-byte sectors. For now, everything that Adiantum needs beyond what's already in the kernel is gathered into a single file, including NH, Poly1305, and XChaCha12. We can split those out -- and reuse them, and provide MD tuned implementations, and so on -- as needed; this is just a first pass to get Adiantum implemented for experimentation.
2020-06-26Reference PRs consistently.jruoho
2020-06-01LIBISPRIVATE=yeschristos
2020-06-01Set LIBISPRIVATE=yeschristos
2020-05-01Fix two tests.isaki
- kqueue_mode_{RDONLY,RDWR}_READ: Fix expected value. This is rest of rev1.9. - AUDIO_SETINFO_params_simul: Fix condition. This happens on full-duplex, not bi-directional. These affect only standalone test, not atf.
2020-03-26Add tests for poll(POLLIN) before read().isaki
This affects only standalone test, not atf.
2020-03-26Sync with sys/dev/audio/audio.c rev1.65.isaki
> Fix to start recording immediately when open() with READ mode is called. This affects only standalone test, not atf.
2020-03-25Use exact match to search testname.isaki
This didn't affect test results.
2020-03-21These test cases should now succeed, after fixing rump kernel to handlepgoyette
modules that establish their sysctls via SYSCTL_SETUP()
2020-03-19Mark the swsensor tests "expected failure" since the rump world doesn'tpgoyette
seem to handle the SYSCTL_SETUP stuff. PR kern/55088
2020-03-04Sync with sys/dev/audio/audio.c rev1.62.isaki
> Restore backward compatibility with netbsd-7 audio.
2020-03-02Re-add -lrumpdev dropped in the previous commit.isaki
2020-03-01fix build by adding a Makefile.inc that chains up.christos
2020-03-01Centralize the base rump libraries into a variable used by all the otherchristos
Makefiles so that we can make changes to it centrally as needed and have less mess. Fixes the sun2 build that needs rumpvfs after librump after the latest changes.