Skip to content

Instantly share code, notes, and snippets.

@h-yamamo
h-yamamo / Grub.md
Last active August 21, 2023 00:10
GRUB Legacy: Support over 2 TiB disk and GPT

GRUB Legacy: Support over 2 TiB disk and GPT for debian grub package

The grub legacy (grub 0.97) supported LBA access, but since it was processing in 32-bit, it could only access up to 2 TiB.

By applying patches of the reference site below, it became accessible with 48-bit LBA and supported disks over 2 TiB. However, it didn't support the 64bit feature of ext4, so it couldn't access the recently created ext4 filesystem.

@h-yamamo
h-yamamo / EXFAT.md
Last active August 6, 2020 05:19
exFAT: Build exfat-dkms debian/ubuntu package to get the same usability as vfat(FAT32)

exFAT: Build and install exfat-dkms debian/ubuntu package

exFAT supported mainline kernel from linux-5.4. Regarding distribution support, it was supported by Ubuntu focal and it is supported by Debian bullseye. Until now, I used exfat-fuse. But with fuse, it's just a step away from usability. Native kernel support is easier to use.

Native support even before buster and bionic I wanted the same usability as the above, so I searched for the exfat dkms module. The exfat-dkms package was found in Ubuntu PPA below.

@h-yamamo
h-yamamo / Json-c.md
Last active October 6, 2023 06:01
json-c: Improve performance and robustness for debian/ubuntu include CVE-2020-12762

json-c: Improve performance and robustness for debian/ubuntu

The CVE-2020-12762 vulnerability was announced and then fixed. But there are still many weaknesses. In Debian buster or later, and Ubuntu bionic or later, json-c is used in cryptsetup that is used for encryption of storage device, so it is necessary to improve the quality. So then I made patches for debian/ubuntu.

How to build

@h-yamamo
h-yamamo / TLS13_Camellia.md
Last active February 27, 2024 02:25
Support TLS 1.3 Camellia-GCM for GnuTLS package

Support TLS 1.3 Camellia-GCM for debian/ubuntu (buster or later/focal or later) gnutls28 package

For private use with TLS 1.3, it's assigned the following definitions of ciphersuites for Camellia-GCM.

CAMELLIA-128-GCM:  0xff, 0xca
CAMELLIA-256-GCM:  0xff, 0xcb

And re-add TLS 1.2 Camellia-GCM to priorities ciphersuites.

@h-yamamo
h-yamamo / X448.md
Last active February 8, 2023 06:55
X448, X25519 and ChaCha20-Poly1305 addition to openssl-1.0.2

Support X448, X25519 and ChaCha20-Poly1305 to openssl-1.0.2 for debian/ubuntu

For applications that can not use openssl-1.1, it supports DJB's cryptographic functions for openssl-1.0.2. And supports Camellia-GCM (RFC 6367).

How to build

  • Required packages: packaging-dev, lzip / Preparation: sudo apt-get build-dep openssl or openssl1.0
@h-yamamo
h-yamamo / evp_aead_nettle.h
Created February 22, 2018 14:16
X25519 API and EVP_AEAD API implementation using Nettle library
/* Copyright (c) 2014, 2015, Google Inc.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
@h-yamamo
h-yamamo / RSH.md
Last active November 26, 2022 01:42
Support encryption with X25519 and ChaCha20-Poly1305 for rsh-redone

rsh-redone: Support encryption with X25519 and ChaCha20-Poly1305

Although SSH has sufficient security, handring keys is confusing. I wanted easy encrypted communication tool in my home LAN. I found that the source code of rsh-redone is simpler than that of netkit-rsh. So I decided to add encrypt function to rsh-redone.

How to build and install

Preparation

You need to build and install patched OpenSSL or LibreSSL or BoringSSL: its library libcrypto.so supports X25519 API and EVP_AEAD API.

@h-yamamo
h-yamamo / sun4i-codec.c
Created March 12, 2017 02:37
alternative sound module in linux-4.9 for Allwinner A10,A13,R8,A20 Audio Codec
/*
* Copyright 2014 Emilio López <emilio@elopez.com.ar>
* Copyright 2014 Jon Smirl <jonsmirl@gmail.com>
* Copyright 2015 Maxime Ripard <maxime.ripard@free-electrons.com>
* Copyright 2015 Adam Sampson <ats@offog.org>
*
* Based on the Allwinner SDK driver, released under the GPL.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@h-yamamo
h-yamamo / mmc-blockcount.patch
Created March 12, 2017 02:30
Display block count of eMMC/SD card for linux 4.10
; mmc: Display media block count
;
# linux 4.10
--- linux.orig/drivers/mmc/core/block.c
+++ linux.new/drivers/mmc/core/block.c
@@ -2170,6 +2170,7 @@
static int mmc_blk_probe(struct mmc_card *card)
{
struct mmc_blk_data *md, *part_md;
+ sector_t capacity;
@h-yamamo
h-yamamo / X25519.md
Last active February 20, 2021 02:40
Support X25519 for debian/ubuntu openssl package