-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
explicitly check pkcs11 and azure uri formats, add links to azure docs
- Loading branch information
1 parent
9b2a902
commit 9f23d91
Showing
11 changed files
with
41 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package rfc7512 | ||
|
||
import "regexp" | ||
|
||
var re *regexp.Regexp | ||
|
||
func init() { | ||
aChar := "[a-z-_]" | ||
pChar := "[a-zA-Z0-9-_.~%:\\[\\]@!\\$'\\(\\)\\*\\+,=&]" | ||
pAttr := aChar + "+=" + pChar + "+" | ||
pClause := "(" + pAttr + ";)*(" + pAttr + ")" | ||
qChar := "[a-zA-Z0-9-_.~%:\\[\\]@!\\$'\\(\\)\\*\\+,=/\\?\\|]" | ||
qAttr := aChar + "+=" + qChar + "+" | ||
qClause := "(" + qAttr + "&)*(" + qAttr + ")" | ||
|
||
re = regexp.MustCompile("^pkcs11:" + pClause + "(\\?" + qClause + ")?$") | ||
} | ||
|
||
// IsPKCS11URI checks if the uri is in the pkcs11 format | ||
func IsPKCS11URI(uri string) bool { | ||
return !re.MatchString(uri) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
// +build !pkcs11 !cgo | ||
|
||
package main | ||
package server | ||
|
||
import ( | ||
"crypto" | ||
"fmt" | ||
) | ||
|
||
func loadURI(uri string) (crypto.Signer, error) { | ||
func loadPKCS11URI(uri string) (crypto.Signer, error) { | ||
return nil, fmt.Errorf("pkcs#11 support is not enabled") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.