Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding/pem: TestFuzz fails again #22238

Closed
rsc opened this issue Oct 12, 2017 · 5 comments
Closed

encoding/pem: TestFuzz fails again #22238

rsc opened this issue Oct 12, 2017 · 5 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Oct 12, 2017

Apparent repeat of #19829. Maybe I didn't fix it well enough last time.

--- FAIL: TestFuzz (0.00s)
	pem_test.go:242: Encode of &pem.Block{Type:"𥁵\U0005cac4\U0002ddf6\U0010ae54\U000b322e\U000f1bd4\U00073f73:\U000ec347\U0008e656\ue478\U000ee00d鰭𢢗\U000acf01\U00109e18\U000d1766\U00046126", Headers:map[string]string{}, Bytes:[]uint8{}} decoded as (*pem.Block)(nil)
FAIL
FAIL	encoding/pem	0.033s
@rsc rsc added this to the Go1.10 milestone Oct 12, 2017
@bradfitz bradfitz added the NeedsFix The path to resolution is known, but the work has not been done. label Nov 15, 2017
@rsc rsc modified the milestones: Go1.10, Go1.11 Nov 22, 2017
@mvdan
Copy link
Member

mvdan commented Feb 23, 2018

@iwdgo
Copy link
Contributor

iwdgo commented Jun 8, 2018

Issue does not appear on 1.10.3 and all tests succeed (Windows).

go test -run=TestFuzz
PASS
ok      .../golang/go/src/encoding/pem    1.062s

@ALTree ALTree added the Testing An issue that has been verified to require only test changes, not just a test failure. label Jun 8, 2018
@ianlancetaylor ianlancetaylor modified the milestones: Go1.11, Go1.12 Jun 23, 2018
@arbrix
Copy link
Contributor

arbrix commented Aug 30, 2018

I've reproduced it on go1.11 (darwin/amd64) by stress tool

--- FAIL: TestFuzz (0.00s)
    pem_test.go:242: Encode of &pem.Block{Type:"屗\U0007dd5d\U00053406\U000e7c86𧣳\U000b3b5b\U00064307\U000ffce6𦸚\U0005781d倂\U000d1575\U00081bb0:\U00061bb0\U000a200c\U000b076f\U000a3af1\U00107c9e\U000777e5\U001000a2𢌡\U00068b5f\U000790e4\U000ae845\U000bf94a", Headers:map[string]string{}, Bytes:[]uint8{}} decoded as (*pem.Block)(nil)
--- FAIL: TestFuzz (0.00s)
    pem_test.go:242: Encode of &pem.Block{Type:"\U0010f079\U000a4b4a\U00011f7c\U0001182b:\U0001c8af\U0008cd97\U0006a22a\U00104b8b\U00074b3cᕤ\U0001bfe3\U000de4ec\U000cbd63\uf423\U000f5f6b\U000b6c26\U000ffd28\U00090e86\U0003b003\U000e5294\U000c53af𬈒\U00081e5d\U000316ae\U0004f92d\U0004acf0\U000e8e4f\U0009ec34\U000ab9f5\U000b500f\U0007a161\U0008d652\U000a11bb\U00071097\U0008558f\U000e21e6\U000fc689\U000b1dd2𫋍𒁾", Headers:map[string]string{}, Bytes:[]uint8{}} decoded as (*pem.Block)(nil)
--- FAIL: TestFuzz (0.00s)
    pem_test.go:242: Encode of &pem.Block{Type:"\U000389fc\U0010f8d8㫜\U000b52fe𒒟\U00088c67\U000681c8\U0004973d:\U000eb8f4\U000dd900\U00079233\U0009c736\U0010516e\U0008ec0f\U0010e87a\U0004a820\U00016666\U00035115\U000b8c89\U000f5f25\U000fa45f\U00079e0e\U000155f8떽𦄃\U00010f78𝨼\U000ce364\U000b4629\U000c8e7b", Headers:map[string]string{}, Bytes:[]uint8{}} decoded as (*pem.Block)(nil)
--- FAIL: TestFuzz (0.01s)
    pem_test.go:242: Encode of &pem.Block{Type:"\U000b2bb4\U000c180f\U00037c7d朐\U000bc2a1\U0007f1e4\U0003133d\U000a3b76󠄤\U000f5230\U000a6f72\U00089f6b\U000b3b82\U000925d1\U0010fdc2\U000f38ce\U000b92d8\U000d2002\U000b3f46\U000f6dd0\U00092a32\U0005a37a\U000e9657\U000e5779𦗗\U0006bd2a⽇\U0006268e\U00093c43\U00013d3a:", Headers:map[string]string{}, Bytes:[]uint8{}} decoded as (*pem.Block)(nil)
--- FAIL: TestFuzz (0.00s)
    pem_test.go:242: Encode of &pem.Block{Type:"𢨞\U000e790c:\U0005dba2\U001087ee\U00086e9d\U000cbb57\U00035df1\U000f6620\U00034b16\U00015f41\U00090d52\U000f1c3d\U000c3185\U0004ce63\U000c2fad\U000e4268\U00071f80\U000abdee\U001048fd\U00016b49\U000a0bc2", Headers:map[string]string{}, Bytes:[]uint8{}} decoded as (*pem.Block)(nil)
--- FAIL: TestFuzz (0.00s)
    pem_test.go:242: Encode of &pem.Block{Type:"\U0006021e\U0005106a\U000f0a84\U000b86bd\U000e1acb\U0010c4d7\U0006e729:\U000e46c0\U00052591\U000b46af\U00090c0e\U000b679a㍶\U000ae0c9\U00012973\U0007a141\U000e587d\U000452ef\U000b2f64\U000a1e70𦙞\U00109c89\U000e1a91\U0008a6ee\U000330dd\U000f6e05\U00036407雸\U00077e0f\U000e570c\U0010ae58\U000f161e𥅀\U000f4c55\U0003a996𦕜\U000c8f94\U000761e9", Headers:map[string]string{}, Bytes:[]uint8{}} decoded as (*pem.Block)(nil)
--- FAIL: TestFuzz (0.00s)
    pem_test.go:242: Encode of &pem.Block{Type:"𨩭\U00093c55𦖰\U0003d91a\U000ecf46\U0001fba0\U0003638b戄߉\U0007932b\U000da69c\U00093e4b\U00091d80\U000655e1\U0008d5f9\U0009de49\U000ca027\U00059041\U000c6864𡼅\U0009c33a\U000f5ca1\U000c5a92\U00085772\U000e763d\U0003cad7\U000b79f2\U0003a9f0\U000b16e4\U00101467\U00063655\U0006084e\U000b7ae3\U000fffe6\U000cc904\U001099a7\U00031dd2\U0003c035:\U0010f712\U000bc464𣳀𪜤", Headers:map[string]string{}, Bytes:[]uint8{}} decoded as (*pem.Block)(nil)
--- FAIL: TestFuzz (0.00s)
    pem_test.go:242: Encode of &pem.Block{Type:"\U00048278\U000bfd58:", Headers:map[string]string{}, Bytes:[]uint8{}} decoded as (*pem.Block)(nil)
--- FAIL: TestFuzz (0.00s)
    pem_test.go:242: Encode of &pem.Block{Type:"\U00093bdf\U00095034\U000a7ea3𗻻\U0007120a\U000a40a9\U0009bc78\U0003ac4d\U0010489c\U000f655e\U000ba80b\U0007b095:\U00092725\U000ecaac\U000e4389\U0008d61e\U0010d567\U0004b1a6\U00092a84\U000a50b7\U000ddb4d\U00092466\U000dbd60\U00098fa1\U000967e9\U000a7ee0𝈂\U00061878\U0006f2e6館\U001048e8\U000b1d2e\U000f2e93\U000e9d5b\U000dbbb4\U000c87a3\U0010fa70\U0008f70c\U000ae675\U000adcc0", Headers:map[string]string{}, Bytes:[]uint8{}} decoded as (*pem.Block)(nil)
--- FAIL: TestFuzz (0.00s)
    pem_test.go:242: Encode of &pem.Block{Type:"\U000b95d5\U000e7c30\U000a0274\U00054a8e\U0004f45b\U000526fb\U000611a7\U000e9d1a\U00047cfd\U00014a99:\U000ad805𠒫\U000d5e25\U0005a1ce\U0005f523\U000b6668\U000d9e1d\U0003d368\U000ff089\U0010a399𤫫\U000974c8\U00107365\U00048aa9\U000ca913\U000c970a\U000382e8\U000a7f7f嬲", Headers:map[string]string{}, Bytes:[]uint8{}} decoded as (*pem.Block)(nil)
--- FAIL: TestFuzz (0.01s)
    pem_test.go:242: Encode of &pem.Block{Type:"\U0010ab98\U0005a829\U0009f10b\U00011f2a厐\U00033111:\U0004491d䪪\U00097536\U0003aaa8\U000b82f5\U000dc5e3\U000435f4\U0007f7ff\U00056087\U00084e58\U00058b95\U000d10d8\U00041e61\U001092fc\U0008016c\U000e580d\U000a70d1\U0008e24e\U0010ad39\U001089d2\U000ef40e\U000dc0b9\U000c8bfd\U000ec7e2\U000f8349\U000d69b9\U000f78d1\U000663f8\U000960d9\U00102057🖄", Headers:map[string]string{}, Bytes:[]uint8{}} decoded as (*pem.Block)(nil)
--- FAIL: TestFuzz (0.00s)
    pem_test.go:242: Encode of &pem.Block{Type:"\U000c8811\U000dae96\U000fb603\U000d00fc\U00044ba8𮂖\U00042956\U000b2425\U000b509b\U000a9354캅\U0008491c𦅣\U0007df7c\U000c3c1c𦰨\U0008e01d:𡧫\U000c4fdb\U0008fddc\U0008c7d4\U000479a8", Headers:map[string]string{}, Bytes:[]uint8{}} decoded as (*pem.Block)(nil)
--- FAIL: TestFuzz (0.01s)
    pem_test.go:242: Encode of &pem.Block{Type:"\U000aea38\U00062d8d\U000e00a7\U0001be18\U000f7296\U000886dc\U0009b872\U0005501d\U000f3755\U0008b8f7\U000ffc0b\U000b6159\U000f37bd\U000e544e뽒\U00042061\U000f5322\U00074537\U000c5998:\U0010cb38\U0004a547\U00054105\U00105b92", Headers:map[string]string{}, Bytes:[]uint8{}} decoded as (*pem.Block)(nil)
--- FAIL: TestFuzz (0.01s)
    pem_test.go:242: Encode of &pem.Block{Type:"\U000d4f00\U00082f2b\U0009c467\U000abff0\U000ef245\U0005bc71\U000badd4\U0003e922\U0008ee19\U000932cd\U00088093\U0009ed30\U00032d71𧩂\U000eef6d\U000e0984\U0008ef19:𫌞\U000ee94b\U0003ca2a\U0003e63f픖\U000a4a73\U000faba7𩝖\U00086af1\U000e07c9", Headers:map[string]string{}, Bytes:[]uint8{}} decoded as (*pem.Block)(nil)
--- FAIL: TestFuzz (0.00s)
    pem_test.go:242: Encode of &pem.Block{Type:"\U000ca7a2\U000f27e0\U00105f98\U0004d5db\U000d34c6\U00107e07\U0005a262\U000603cf\U00074485\U00089552\U00077f15\U001025fd\U000f95d0\U000f10de\U000136a1\U000b0860䁫\U0007557d\U0003e084\U000b18d8\U000ba474:\U000ed7be𧾾\U00047e51\U00033f24𗓈\U00058f70\U000fe3a8\U000da08a\U000d4951\U0007af1a\U000cdcb7\U0008aa25\U00108630", Headers:map[string]string{}, Bytes:[]uint8{}} decoded as (*pem.Block)(nil)

@arbrix
Copy link
Contributor

arbrix commented Aug 31, 2018

After the investigation, I've found that all these cases due to : at the Type section, that lead that the end PEM line processing as Header and break other logic, I suggest changing TestFuzz for mark such cases as invalid.

@gopherbot
Copy link

Change https://golang.org/cl/132635 mentions this issue: encoding/pem: PEM type should not contain ':'

@golang golang locked and limited conversation to collaborators Sep 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

9 participants