Skip to content
This repository has been archived by the owner on Aug 24, 2021. It is now read-only.

Commit

Permalink
fix: invalid signature parsing (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k authored and daviddias committed Nov 7, 2017
1 parent 8f7ae01 commit b1f8bd4
Show file tree
Hide file tree
Showing 26 changed files with 28 additions and 30 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@
"Łukasz Magiera <magik6k@users.noreply.github.com>",
"Łukasz Magiera <magik6k@gmail.com>"
]
}
}
6 changes: 3 additions & 3 deletions src/resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ exports.tree = (block, options, callback) => {
'tree'
]

paths = paths.concat(personInfoPaths.map(e => 'author/' + e))
paths = paths.concat(personInfoPaths.map(e => 'committer/' + e))
paths = paths.concat([...node.parents.keys()].map(e => 'parents/' + e))
paths = paths.concat(personInfoPaths.map((e) => 'author/' + e))
paths = paths.concat(personInfoPaths.map((e) => 'committer/' + e))
paths = paths.concat(node.parents.map((_, e) => 'parents/' + e))

if (node.encoding) {
paths.push('encoding')
Expand Down
4 changes: 1 addition & 3 deletions src/util/commit.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ exports.serialize = (dagNode, callback) => {
if (dagNode.signature) {
lines.push('gpgsig -----BEGIN PGP SIGNATURE-----')
lines.push(dagNode.signature.text)
lines.push(' -----END PGP SIGNATURE-----')
}
lines.push('')
lines.push(dagNode.message)
Expand Down Expand Up @@ -72,12 +71,11 @@ exports.deserialize = (data, callback) => {

let startLine = line
for (; line < lines.length - 1; line++) {
if (lines[line + 1] === ' -----END PGP SIGNATURE-----') {
if (lines[line + 1][0] !== ' ') {
res.signature.text = lines.slice(startLine + 1, line + 1).join('\n')
break
}
}
line++
break
}
default:
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/006549c246fa9b838824b5ee9a1d05880f8c8e5c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
x5�;�0@j�b{�5��@����8�KP��(���M55M$���~�P)D�Q$:�F��(�`�e��e���y� S? ��hj�KvOX��']t����w*��Aˉ� 3w��r�17-�� ]*�
2 changes: 2 additions & 0 deletions test/fixtures/1c4f163f2a7dbea6720f5ca810af5a660dee6986
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
x��K
�0@]�� 23��� �-&�VlSJ��\�����W��M�S�E4�)��{v"e���8Z��d�6V�6�,��a��$8dD.9e)� 9((�����U�U?����P�./�G.�.7� ��� U������z�6·��3A�
Binary file removed test/fixtures/1e2cb60e9e29de3320459f02cb156b66a86925aa
Binary file not shown.
2 changes: 2 additions & 0 deletions test/fixtures/2f0276035d659023b60da5bc3537bf37b63429a7
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
x�=
1@a�bzQ�,�XX�z�L�]]��E���6��z-M���0Δ �`p�'��2P�y�Vg���5aD�N��J��Q�~x���(��DO��}�3�Ӊީ������SRʨ�����ʕ��(&*�
2 changes: 2 additions & 0 deletions test/fixtures/47facf5f744cfe2a61b740117f4c0109faeb69a5
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
x��K
�0Eg� ��k����4���mJ���Kpv�� '�y�W-lwut�Ȧ34�읕��8H�A�>��q�Zㆥ�� ��(2e��pd�iR�XL�ĩ��S���L�����Xp�'���T�f�D䥷zOU[[_��Ou����7B�
Expand Down
Binary file removed test/fixtures/4bbc624c5e1d7e13fac32698c20cf47bc7df3ffa
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed test/fixtures/6860d53002bcd8f9a2e371462743340abc1c47a8
Binary file not shown.
2 changes: 0 additions & 2 deletions test/fixtures/70ce33c808791776ea89c98bb28bdab6352fc6e3

This file was deleted.

2 changes: 2 additions & 0 deletions test/fixtures/942e6630a10f089e751a11acb9b10ecc31254727
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
x��K
1D]��r�H&�_���+7�!����0D��fЅ������Pr�UWu&���0��^��) O�&��!����r��G�&7�X�;e�ё���$��� 2��[K�=�Pf��a�s!X�4���p,t���Ӄv��-,�,�/>@�:ιRÆ7�Z�m������}{Vh^Y
Binary file removed test/fixtures/a847fad8424bf2fed664658d215921a9cf0275a5
Binary file not shown.
Binary file not shown.
1 change: 0 additions & 1 deletion test/fixtures/aa9080345b7881124ee5a605b72d1d7b6892d1dc

This file was deleted.

2 changes: 2 additions & 0 deletions test/fixtures/b4aa6a1ee1a3a3237e2551a76b91b840f38678b5
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
x���j�0E��W̾8�1�-!�v�l���f�y[ƨ�ϯ� ����2Ϗ
>�����z��d�)dā���D6L���G2+m�TPr.R�ƈm�qH�fd�.�I"k6�S�e�s�/�Y�FR���4�/�s��ࢳ֎{��M��_��K]��c����ҍcL�3��_��?��J�
Expand Down
Binary file not shown.
2 changes: 0 additions & 2 deletions test/fixtures/bcd6c57873ddd85c30e7758a5c34d5ffa37496f8

This file was deleted.

2 changes: 0 additions & 2 deletions test/fixtures/bdc9b0f98b578af9015359103503d5de3218efdd

This file was deleted.

2 changes: 0 additions & 2 deletions test/fixtures/ce717819ba52636f465c805794cef0c3103770c4

This file was deleted.

3 changes: 0 additions & 3 deletions test/fixtures/d94c1dbabf13cff8bed80d8818c41b20bca4ee39

This file was deleted.

Binary file removed test/fixtures/dee159b7de821f3dcfc75b9e4f3857689759aa37
Binary file not shown.
1 change: 1 addition & 0 deletions test/fixtures/ea115a50c3854a03b479b0b4ca2197cc9d5ce9dc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
x��AjC1 D��)�/ɱeJ颫B!�R����[z�z�d7<�1L�v��<�]R��U�9�Q��E���T<v��+qt7��:�Z0�yI��p�h�I&�Œ]�K�{?$�f�R�� SM������D+�E'?�<v��+�������7������6�W�H��}`x^:�Eן����S��”����QSn
22 changes: 11 additions & 11 deletions test/fixtures/objects.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
[
"1e2cb60e9e29de3320459f02cb156b66a86925aa",
"aa9080345b7881124ee5a605b72d1d7b6892d1dc",
"ce717819ba52636f465c805794cef0c3103770c4",
"bdc9b0f98b578af9015359103503d5de3218efdd",
"dee159b7de821f3dcfc75b9e4f3857689759aa37",
"5b512d94984f098a904e3fd816f6fb9aab716ff7",
"5e98ad8f7d897f1ea0c73795a6786c7f75c4c823",
"006549c246fa9b838824b5ee9a1d05880f8c8e5c",
"2f0276035d659023b60da5bc3537bf37b63429a7",
"b4aa6a1ee1a3a3237e2551a76b91b840f38678b5",
"e247bdd4cdbe6a3b447cb2dcf1fa03fba2f3d64a",
"933b7583b7767b07ea4cf242c1be29162eb8bb85",
"bcd6c57873ddd85c30e7758a5c34d5ffa37496f8",
"ea115a50c3854a03b479b0b4ca2197cc9d5ce9dc",
"788506cb0585ff19bfe9a5add28ab03d1b6db165",
"672ef117424f54b71e5e058d1184de6a07450d0e",
"6860d53002bcd8f9a2e371462743340abc1c47a8",
"1c4f163f2a7dbea6720f5ca810af5a660dee6986",
"af99300d66a5078022b14c388d214046cb2647ca",
"adf239853d9b280be483592b40c4bd8b5d9fb524",
"d31ec9422b3048f104b4c090cf1c0f5be0963cd9",
"4bbc624c5e1d7e13fac32698c20cf47bc7df3ffa",
"a847fad8424bf2fed664658d215921a9cf0275a5",
"a8c08f86bf82f9530ebd4e46a2149a2147d95b41",
"47facf5f744cfe2a61b740117f4c0109faeb69a5",
"ffef5350b6f8762cc6272b0255e968f50b6577ed",
"7ffd1401f599c70364eda431d29363e037b2c92c",
"a0f06ca3cdb1e6e7f603794ef1cd9f9867f85551",
"70ce33c808791776ea89c98bb28bdab6352fc6e3",
"942e6630a10f089e751a11acb9b10ecc31254727",
"f5227cbd32973ec90f48f2547e6fe16c80b92bd5",
"5af4dc18899e8ac95904eaf2b4abf1a2ca5e1507",
"832b4a8497de78248f70c06e0f06e785a74fea4c",
"0a1690e0640a212aafed1824eb208ffddab1789b",
"fc80daf21bb484cfd42ad4ed4d17da48638199ea",
"9f358a4addefcab294b83e4282bfef1f9625a249",
"19f0805d8de36b6442e8c573074112ba72ad6780",
"d94c1dbabf13cff8bed80d8818c41b20bca4ee39",
"ba581dd9ae7b099abf29eb6cacace79c4c3b088e",
"fa59b93c6ce9db82ce57de9046eb738e9f3c0952",
"802992c4220de19a90767f3000a79a31b98d0df7"
]

0 comments on commit b1f8bd4

Please sign in to comment.