Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
5bfe0a18
Commit
5bfe0a18
authored
Jun 28, 2016
by
Eric Chiang
Committed by
GitHub
Jun 28, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #490 from ericchiang/reduce-key-id-length
*: update go-oidc to shorten length of key IDs
parents
bdaded57
f5a85e97
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
11 deletions
+25
-11
glide.lock
glide.lock
+3
-3
glide.yaml
glide.yaml
+1
-1
key.go
vendor/github.com/coreos/go-oidc/key/key.go
+7
-7
key_test.go
vendor/github.com/coreos/go-oidc/key/key_test.go
+14
-0
No files found.
glide.lock
View file @
5bfe0a18
hash:
ed84ba1c371faf2f9a0bf64f6a7767a017e663cb99afa273ec5659432bb474d5
updated: 2016-06-28T10:
15:56.223659517
-07:00
hash:
2e6ef5ae85fe17d9b695b37ba6875b438a617692cc1f6fefc682c4e405a4dcf1
updated: 2016-06-28T10:
36:39.146887182
-07:00
imports:
- name: github.com/andybalholm/cascadia
version: 6122e68c2642b7b75c538a63b15168c6c80fb757
- name: github.com/coreos/go-oidc
version:
8ae400b75540a4f57ec549a89b3e9d994c636f2a
version:
5aa9381f6e998aa16cc96b4347d33dcc29792864
subpackages:
- http
- jose
...
...
glide.yaml
View file @
5bfe0a18
...
...
@@ -5,7 +5,7 @@ import:
-
package
:
github.com/andybalholm/cascadia
version
:
6122e68c2642b7b75c538a63b15168c6c80fb757
-
package
:
github.com/coreos/go-oidc
version
:
8ae400b75540a4f57ec549a89b3e9d994c636f2a
version
:
5aa9381f6e998aa16cc96b4347d33dcc29792864
subpackages
:
-
http
-
jose
...
...
vendor/github.com/coreos/go-oidc/key/key.go
View file @
5bfe0a18
...
...
@@ -3,9 +3,9 @@ package key
import
(
"crypto/rand"
"crypto/rsa"
"encoding/
base64
"
"encoding/
hex
"
"encoding/json"
"
math/big
"
"
io
"
"time"
"github.com/coreos/go-oidc/jose"
...
...
@@ -139,15 +139,15 @@ func GeneratePrivateKey() (*PrivateKey, error) {
if
err
!=
nil
{
return
nil
,
err
}
keyID
:=
make
([]
byte
,
20
)
if
_
,
err
:=
io
.
ReadFull
(
rand
.
Reader
,
keyID
);
err
!=
nil
{
return
nil
,
err
}
k
:=
PrivateKey
{
KeyID
:
base64BigInt
(
pk
.
PublicKey
.
N
),
KeyID
:
hex
.
EncodeToString
(
keyID
),
PrivateKey
:
pk
,
}
return
&
k
,
nil
}
func
base64BigInt
(
b
*
big
.
Int
)
string
{
return
base64
.
URLEncoding
.
EncodeToString
(
b
.
Bytes
())
}
vendor/github.com/coreos/go-oidc/key/key_test.go
View file @
5bfe0a18
...
...
@@ -87,3 +87,17 @@ func TestPublicKeyMarshalJSON(t *testing.T) {
t
.
Errorf
(
"got != want:
\n
%s
\n
%s"
,
got
,
want
)
}
}
func
TestGeneratePrivateKeyIDs
(
t
*
testing
.
T
)
{
key1
,
err
:=
GeneratePrivateKey
()
if
err
!=
nil
{
t
.
Fatalf
(
"GeneratePrivateKey(): %v"
,
err
)
}
key2
,
err
:=
GeneratePrivateKey
()
if
err
!=
nil
{
t
.
Fatalf
(
"GeneratePrivateKey(): %v"
,
err
)
}
if
key1
.
KeyID
==
key2
.
KeyID
{
t
.
Fatalf
(
"expected different keys to have different key IDs"
)
}
}
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