Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
01e998a8
Commit
01e998a8
authored
Aug 28, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common: support SHA512 as checksum type [Gh-356]
parent
ce89b357
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
2 deletions
+19
-2
CHANGELOG.md
CHANGELOG.md
+1
-0
common/download.go
common/download.go
+3
-0
common/download_test.go
common/download_test.go
+13
-0
website/source/docs/builders/virtualbox.html.markdown
website/source/docs/builders/virtualbox.html.markdown
+1
-1
website/source/docs/builders/vmware.html.markdown
website/source/docs/builders/vmware.html.markdown
+1
-1
No files found.
CHANGELOG.md
View file @
01e998a8
...
...
@@ -8,6 +8,7 @@ FEATURES:
*
builder/amazon: Copy AMI to multiple regions with
`ami_regions`
. [GH-322]
*
builder/virtualbox,vmware: Can now use SSH keys as an auth mechanism for
SSH using
`ssh_key_path`
. [GH-70]
*
builder/virtualbox,vmware: Support SHA512 as a checksum type. [GH-356]
*
builder/vmware: The root hard drive type can now be specified with
"disk_type_id" for advanced users. [GH-328]
*
provisioner/salt-masterless: Ability to specfy a minion config. [GH-264]
...
...
common/download.go
View file @
01e998a8
...
...
@@ -5,6 +5,7 @@ import (
"crypto/md5"
"crypto/sha1"
"crypto/sha256"
"crypto/sha512"
"encoding/hex"
"errors"
"fmt"
...
...
@@ -60,6 +61,8 @@ func HashForType(t string) hash.Hash {
return
sha1
.
New
()
case
"sha256"
:
return
sha256
.
New
()
case
"sha512"
:
return
sha512
.
New
()
default
:
return
nil
}
...
...
common/download_test.go
View file @
01e998a8
...
...
@@ -81,6 +81,19 @@ func TestHashForType(t *testing.T) {
}
}
if
h
:=
HashForType
(
"sha512"
);
h
==
nil
{
t
.
Fatalf
(
"sha512 hash is nil"
)
}
else
{
h
.
Write
([]
byte
(
"foo"
))
result
:=
h
.
Sum
(
nil
)
expected
:=
"f7fbba6e0636f890e56fbbf3283e524c6fa3204ae298382d624741d0dc6638326e282c41be5e4254d8820772c5518a2c5a8c0c7f7eda19594a7eb539453e1ed7"
actual
:=
hex
.
EncodeToString
(
result
)
if
actual
!=
expected
{
t
.
Fatalf
(
"bad hash: %s"
,
actual
)
}
}
if
HashForType
(
"fake"
)
!=
nil
{
t
.
Fatalf
(
"fake hash is not nil"
)
}
...
...
website/source/docs/builders/virtualbox.html.markdown
View file @
01e998a8
...
...
@@ -47,7 +47,7 @@ Required:
checksum is specified with
`iso_checksum_type`
, documented below.
*
`iso_checksum_type`
(string) - The type of the checksum specified in
`iso_checksum`
. Valid values are "md5", "sha1",
or "sha256
" currently.
`iso_checksum`
. Valid values are "md5", "sha1",
"sha256", or "sha512
" currently.
*
`iso_url`
(string) - A URL to the ISO containing the installation image.
This URL can be either an HTTP URL or a file URL (or path to a file).
...
...
website/source/docs/builders/vmware.html.markdown
View file @
01e998a8
...
...
@@ -50,7 +50,7 @@ Required:
checksum is specified with
`iso_checksum_type`
, documented below.
*
`iso_checksum_type`
(string) - The type of the checksum specified in
`iso_checksum`
. Valid values are "md5", "sha1",
or "sha256
" currently.
`iso_checksum`
. Valid values are "md5", "sha1",
"sha256", or "sha512
" currently.
*
`iso_url`
(string) - A URL to the ISO containing the installation image.
This URL can be either an HTTP URL or a file URL (or path to a file).
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment