{"action":"created","issue":{"url":"https://api.github.com/repos/jedisct1/minisign/issues/15","labels_url":"https://api.github.com/repos/jedisct1/minisign/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/jedisct1/minisign/issues/15/comments","events_url":"https://api.github.com/repos/jedisct1/minisign/issues/15/events","html_url":"https://github.com/jedisct1/minisign/issues/15","id":124313942,"number":15,"title":"Trying to sign a zero-byte file results in 'Undefined error: 0'","user":{"login":"grempe","id":117,"avatar_url":"https://avatars.githubusercontent.com/u/117?v=3","gravatar_id":"","url":"https://api.github.com/users/grempe","html_url":"https://github.com/grempe","followers_url":"https://api.github.com/users/grempe/followers","following_url":"https://api.github.com/users/grempe/following{/other_user}","gists_url":"https://api.github.com/users/grempe/gists{/gist_id}","starred_url":"https://api.github.com/users/grempe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grempe/subscriptions","organizations_url":"https://api.github.com/users/grempe/orgs","repos_url":"https://api.github.com/users/grempe/repos","events_url":"https://api.github.com/users/grempe/events{/privacy}","received_events_url":"https://api.github.com/users/grempe/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-30T07:19:53Z","updated_at":"2015-12-30T08:39:32Z","closed_at":"2015-12-30T08:39:32Z","body":"I was doing some testing and had created a zero byte file foo.txt.  Trying to sign this (using various permutations) was failing for me with `Undefined error: 0`.  I determined that this happens if the file you are trying to sign is empty. If you put anything in the file it signs normally.\r\n\r\nWhile it may not make sense normally to sign a zero-byte file it should handle this more gracefully and with a meaningful error message.\r\n\r\n````\r\n/tmp/test$ ls -la\r\ntotal 0\r\ndrwxr-xr-x  3 glenn 102 Dec 29 23:12 .\r\ndrwxrwxrwt 18 root  612 Dec 29 23:04 ..\r\n-rw-r--r--  1 glenn   0 Dec 29 23:12 foo.txt\r\n\r\n/tmp/test$ minisign -Sm foo.txt -s ~/.minisign/minisign.key\r\nPassword:\r\nDeriving a key from the password and decrypting the secret key... done\r\n\r\nfoo.txt: Undefined error: 0\r\n````"},"comment":{"url":"https://api.github.com/repos/jedisct1/minisign/issues/comments/167957995","html_url":"https://github.com/jedisct1/minisign/issues/15#issuecomment-167957995","issue_url":"https://api.github.com/repos/jedisct1/minisign/issues/15","id":167957995,"user":{"login":"jedisct1","id":124872,"avatar_url":"https://avatars.githubusercontent.com/u/124872?v=3","gravatar_id":"","url":"https://api.github.com/users/jedisct1","html_url":"https://github.com/jedisct1","followers_url":"https://api.github.com/users/jedisct1/followers","following_url":"https://api.github.com/users/jedisct1/following{/other_user}","gists_url":"https://api.github.com/users/jedisct1/gists{/gist_id}","starred_url":"https://api.github.com/users/jedisct1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedisct1/subscriptions","organizations_url":"https://api.github.com/users/jedisct1/orgs","repos_url":"https://api.github.com/users/jedisct1/repos","events_url":"https://api.github.com/users/jedisct1/events{/privacy}","received_events_url":"https://api.github.com/users/jedisct1/received_events","type":"User","site_admin":false},"created_at":"2015-12-30T08:39:32Z","updated_at":"2015-12-30T08:39:32Z","body":"e748f644dd443d84e702fcdf766c4d9d5fe5cb19 should fix it.\r\n\r\nThanks!"}}