銀河の歴史がまた1ページ(日記)

Last Update (2020/07/23 16:06:54)
1997.09.06から数えて counter 番目のアクセスです。

ミラーサイト [www.ceres.dti.ne.jp] [yk.rim.or.jp]

[ホームページ] [日記] [日記ファイル一覧] [読んでいる日記] [FreeBSD] [FreeBSD LINK] [検索]

ページ内目次


■ 宇宙暦 2018.03.08

http://www.ceres.dti.ne.jp/~george/jdiaryB80301.html#20180308

2018.03.08(木) FreeBSD-SA-18:01.ipsecとFreeBSD-SA-18:02.ntpが出てた

とりあえずパッチ適用してみた。適用後のバージョンは以下。

ssh george@n3050 ~ $ freebsd-version -ku
11.1-RELEASE-p7
11.1-RELEASE-p7
ssh george@n3050 ~ $

FreeBSD-SA-18:01.ipsecの方はFreeBSD 10.x用は改訂版(v1.1)が出た(3/8)。

FreeBSD 10.x用のv1.0入れちゃった人は上のサイトから戻すパッチとv1.1パッチを入れるべし、とのこと。

1日くらい様子見するのが良いのかな?(ぉぃ

freebsd-update fetch && freebsd-update install だと、この手の戻す局面には対応していないのかしらん?


■ 宇宙暦 2018.03.11

http://www.ceres.dti.ne.jp/~george/jdiaryB80301.html#20180311

2018.03.11(日) オレオレ証明書の作成とMSYS Bash パス書き換え回避の黒魔術

tag:msys2,msys

オレオレ証明書の作成とMSYS Bash パス書き換え回避の黒魔術

ちょっとローカルのminikubeでdocker-registryを動かしている最中。

registryはTLSを要求してくるので、とりあえずオレオレ証明書を作成。

そして、MSYS Bash ( Git for Windows ) の黒魔術を目にしたのでメモ。

cd /c/home/minikube/charts/docker-registry-memo
openssl genrsa 2048 > server.key
# for bash
# openssl req -new -key server.key -batch  -subj '/C=JP/ST=Tokyo/L=Tokyo/O=Example Ltd./OU=Web/CN=registry-docker-registry.default.svc.cluster.local'  > server.csr
# for Git-Bash for Windows (MSYS bash) ( MSYS black magic )
openssl req -new -key server.key -batch  -subj '//C=JP\ST=Tokyo\L=Tokyo\O=Example Ltd.\OU=Web\CN=registry-docker-registry.default.svc.cluster.local'  > server.csr
echo "subjectAltName=DNS:registry-docker-registry.default.svc.cluster.local" > san.ext
openssl x509 -days 3650 -req -signkey server.key < server.csr > server.crt -extfile san.ext

# 内容確認
openssl x509 -text < server.crt

Git-Bash for WindowsのようなMSYS環境では、-subj '/CN=xxxx' と書くと 「Subject does not start with '/'.」のようなエラーが出る。

MSYSの場合、/から始まる文字列(例えば /CN=Name )は何でもWindows風のフルパス ( C:/Program Files/Git/CN=Name ) に書き換えるという動作をする。

今回はこれでは困るので、MSYS黒魔術を使う。

なお、より詳しい解説は上のリンクから、または、以下のコピー(ぉぃぉぃ)を参照のこと。

MSYS黒魔術おそるべし。 これHyper-V有効にしてMicrosoft StoreからDebianとかUbuntu入れた方が幸せになるのかしら?

...。

MSYS Git-Bash (Git-for-Windows) の /から始まるオプションがWindows風のフルパスに書き換えられる事象の回避策

What is this magic?

For those curious about exactly what is going on here, I can explain this mystery. The reason is that MSYS reasonably assumes that arguments containing slashes are actually paths. And when those arguments are passed to an executable that haven't been compiled specifically for MSYS (like openssl in this case) then it will convert POSIX paths to Win32 paths. The rules for this conversion are quite complex as MSYS tries its best to cover most common scenarios for interoperability. This also explains why using openssl from a windows command prompt (cmd.exe) works fine, because no magical conversions are made.

You can test the conversion like this.

$ cmd //c echo "/CN=Name"
"C:/Program Files (x86)/Git/CN=Name"

We can't use the echo executable that comes with MSYS since it was compiled for MSYS, instead we'll use the echo builtin in cmd. Notice that since cmd switches starts with / (common for windows commands) we need to handle that with double slashes. As we can see in the output the argument was expanded to a windows path and it becomes clear why openssl does indeed claim that Subject does not start with '/'..

Let's see some more conversions.

$ cmd //c echo "//CN=Name"
/CN=Name

Double slashes makes MSYS believe the argument is a windows style switch which results in stripping a / only (no path conversion). You would think that with this we could just use slashes to add more key/value pairs. Let's try that.

$ cmd //c echo "//O=Org/CN=Name"
//O=Org/CN=Name

Suddenly the double slashes in the start isn't stripped down. This is because now, with a slash following the initial double slashes, MSYS thinks we are referencing a UNC path (e.g. //server/path). If this was passed to openssl it would skip the first key/value saying Subject Attribute /O has no known NID, skipped.

Here is the relevant rule from the MinGW wiki explaining this behavior:

An argument starting with 2 or more / is considered an escaped Windows style switch and will be passed with the leading / removed and all \ changed to /.
Except that if there is a / following the leading block of /, the argument is considered to be a UNC path and the leading / is not removed.

In this rule we can see the method we could use to create the argument we want. Since all \ that follows in an argument starting with // will be converted to plain /. Let's try that out.

$ cmd //c echo "//O=Org\CN=Name"
/O=Org/CN=Name

And as we can see it does work.

Hope this demystifies the magic a little bit.


■ 宇宙暦 2018.03.18

http://www.ceres.dti.ne.jp/~george/jdiaryB80301.html#20180318

2018.03.18(日) FreeBSD-SA-18:03.speculative_execution 出た

CPUの命令の投機実行による脆弱性を緩和するパッチ出てたので適用。

アメリカでLinux Kernelへのパッチから噂になったのが去年の年末からだったな。

Windows / MacOSX / iOS / Linux あたりのメジャーどころには最初から脆弱性情報が共有されていたようだけど、*BSDとかマイナーOSには情報公開されずに大変だったらしい。


■ 宇宙暦 2018.03.24

http://www.ceres.dti.ne.jp/~george/jdiaryB80301.html#20180324

2018.03.24(土) バーチャルユーチューバー3月編

今年の初めからバーチャルユーチューバーが認知されてきてわずか数カ月。

現在バーチャルユーチューバーは880体を数えるようになったようだ。

そのうち、今のついったーみたいな感じで、(連日うpするかどうかはともかく)、YouTuberする時代が来るのかもしれん。

上の記事でもイチオシされていた月ノ美兎(つきのみと)、確かに色々と凄かったのでお勧めw

いちから株式会社の歪んだCOOいわく、「リスクを感じた」というwww

1時間を超えるロング動画が多いが、本人が手ずから編集した「10分間でわかる月ノ美兎【にじさんじ公式】」を公開してくれているので、最初はそちらからドウゾ。

ニコニコ動画にも勝手に動画が転載されていたり、ハイライトシーン選抜編集された動画が投稿されていて、こちらも短時間なので見やすい。

月ノ美兎の生放送は集まる人数が凄まじいけど、なんとなくわかる。 何が飛び出してくるか、それとも放送事故が起こるのか、予想できない感ある。 (リスクを感じたってそういう意味なのか?)

YouTuberの動画って数分から10分程度に短く編集して気軽に見物できるものが主流だと思っていたのだが、 にじさんじ企画だと生放送系の超ロングトーク(長いのだと6時間とか・・・)が多い。

見る方も大変な時代がやってきた。

つか、今の時代、時間をドブに捨てる物件多すぎて大変だよホント。

p.s.

最初の記事で名前が出ていたバーチャルおばあちゃんの放送もニコ動に転載されていたので紹介。


日記ファイルリスト


日記ファイルリスト最新100件


Copyright(c) 1996-2020 George(小濱 純). All rights reserved.
私の作成したページへのリンクはご自由にどうぞ。
このページに間違いや要望などがありましたら george@yk.rim.or.jp まで御連絡ください。
メール本文に 6020-5440-3372 と書いて頂くと、ウチのSPAMフィルタを通過できます(2009-06-14から2020-12-31まで)。

[ホームページ] [日記] [日記ファイル一覧] [読んでいる日記] [FreeBSD] [FreeBSD LINK] [検索]

home: <george@yk.rim.or.jp> or <george@ceres.dti.ne.jp>
(I am using white list SPAM filter. To avoid it, please write 6020-5440-3372 in mail body. This key word is valid since 2009-06-14 until 2015-12-31.)