crypto: Correct s2k type constants. They are 0,1,3 according to both the RFC: http://tools.ietf.org/html/rfc4880#section-3.7

And according to the gpg implementation: http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git&a=search&h=refs%2Fheads%2FSTABLE-BRANCH-2-0&st=grep&s=s2kmode

R=agl
CC=evn, golang-dev
https://golang.org/cl/11355046
This commit is contained in:
Drew Hintz
2013-07-16 17:39:57 -04:00
committed by Adam Langley
parent c4978816b9
commit 0982ebf089
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -97,12 +97,12 @@ func Parse(r io.Reader) (f func(out, in []byte), err error) {
}
switch buf[0] {
case 1:
case 0:
f := func(out, in []byte) {
Simple(out, h, in)
}
return f, nil
case 2:
case 1:
_, err = io.ReadFull(r, buf[:8])
if err != nil {
return
+2 -2
View File
@@ -66,9 +66,9 @@ var parseTests = []struct {
spec, in, out string
}{
/* Simple with SHA1 */
{"0102", "hello", "aaf4c61d"},
{"0002", "hello", "aaf4c61d"},
/* Salted with SHA1 */
{"02020102030405060708", "hello", "f4f7d67e"},
{"01020102030405060708", "hello", "f4f7d67e"},
/* Iterated with SHA1 */
{"03020102030405060708f1", "hello", "f2a57b7c"},
}