Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fork #15

Open
wants to merge 69 commits into
base: teleport.1
Choose a base branch
from

Conversation

gabrielcorado
Copy link

Fetched from the Microsoft repo on 10/04 (last commit being ported) and merged to our main branch.

shueybubbles and others added 30 commits March 28, 2023 15:48
* refactor!: enable hidden admin protocol

* feat: admin protocol

* fix admin test to skip in appveyor

* fix protocol parsing logic in URL()

* use SplitN

* handle ipv6 in URL()

* Update docs for v1.0 tag

BREAKING CHANGE: Add `Hidden()` method to `ProtocolParser` interface
* go mod vendor npipe to this repo

* switch to internal package
* fix: mips and mipsel builds

fixes: denisenkom#123

* swap el or le
* Allow for local dns resolution with a custom dialer

* Use a new dialer type

* fix unit test

* Add changelog & readme
…er (denisenkom#126)

* Added MarshalText() and UnmarshalJSON interfaces

- The existing MarshalText() for the UniqueIdentifier type had a bad signature. It omitted returning an error that the interface expects.
- Added UnmarshalJSON() interface to the UniqueIdentifier type with a test as well

* use strings.Replace instead of ReplaceAll
Remove message referring to MSFT fork since we are there.
* Fix: Handle extended chars in SQL instance names
* add core CEK parameters and types

* add column encryption featureext

* Add parsing of always encrypted tokens

* implement local cert key provider

* use key providers for decrypt

* implement EncryptColumnEncryptionKey for local cert

* add cipher data to parameters

* copy swisscom code locally

* implement Encrypt

* don't claim to support enclaves

* update readme

* fix Scan to use correct data types

* make cert store provider go1.17+

* rename files for clarity
* update dependencies and min Go version

* update reviewdog

* remove old SQL versions from PR build
Update title to stand out in search results.
* Feat: Implement change password during login

* use -v for go test

* move assert usage to go117+
shueybubbles and others added 27 commits August 31, 2023 11:36
Change parameters to match driver rather than sdk
This commit fixes denisenkom#136.  Adds support for TDS8. TDS8 connection
can now be used by specifying encrypt=strict. TrustServerCertificate=true
will not come into effect when encrypt is set to 'strict'.
…nisenkom#155)

* Add context parameter to key provider interface

* update error handling for AE key providers
* FEAT:support environment config of krb5

* update readme and version

* use client keytab file as default
…enisenkom#158 (denisenkom#159)

* fix: Added multisubnetfailover option that can be set to false to prevent issue denisenkom#158
* Fix mappings between LCIDs and code pages.

* Add test for fetching various LCIDs.

* Address Github automation feedback.

* Refine comments.

---------

Co-authored-by: Sergey Ten <[email protected]>
* Reserve extra space for out parameter + tests.

* Test for []byte parameter.

---------

Co-authored-by: El-76 <[email protected]>
* lazy initialization of charset maps

* initialize each charsetmap separately

* switch from init to get
* Update dependencies

* support dataverse endpoint
* Refactor UniqueIdentifier tests

* Parallelize tests

* Add NullableUniqueIdentifier type

* Add missing test case for UniqueIdentifier

* Improve error message

* Rename to NullUniqueIdentifier

* Add NullUniqueIdentifier to TestBulkcopy

* Add uniqueidentifier parsing to the list of Features

* Add Valid bool to NullUniqueIdentifier

* Handle null in UnmarshalJSON()

* Handle !Valid in Value(),String(),MarshalText()

---------

Co-authored-by: Norman Gehrsitz <[email protected]>
* preserve type information for Valuer parameters

* support uniqueidentifier in AE

* update readme
* fix: support nullable types for bulkcopy

* Add test cases for all nullable types

* Fix test cases

* Add bulkcopy test for invalid nullable types

* Add case in convertInputParameter to bypass uniqueidentifier type

* Add test cases for invalid nullable test

* Revert bypass change
* handle sql.NullTime parameters

* Match SQL sizes for sql.Nullxxx integer types

* handle custom nullable Valuer implementations
* Vulnerabilty depency x/net

* Att Dependencies
* Accept hierarchyid as a valid type

* error

* derp

* geography and geometry

* Return value

* Tests

* Typo

* Upper

* hasSize
if err != nil {
panic(err)
}
bytes[i] = byte(b)

Check failure

Code scanning / CodeQL

Incorrect conversion between integer types High

Incorrect conversion of a signed 32-bit integer from
strconv.ParseInt
to a lower bit size type uint8 without an upper bound check.

Copilot Autofix AI 1 day ago

To fix the problem, we need to ensure that the value parsed by strconv.ParseInt is within the range of a byte (0 to 255) before converting it. This can be done by adding a check to ensure the parsed value is within the valid range for a byte. If the value is out of range, we should handle the error appropriately.

  1. Parse the string using strconv.ParseInt with a bit size of 8 to directly get an 8-bit integer.
  2. Check if the parsed value is within the range of a byte (0 to 255).
  3. If the value is within the range, convert it to a byte.
  4. If the value is out of range, handle the error (e.g., by panicking or returning a default value).
Suggested changeset 1
aecmk/localcert/keyprovider.go

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/aecmk/localcert/keyprovider.go b/aecmk/localcert/keyprovider.go
--- a/aecmk/localcert/keyprovider.go
+++ b/aecmk/localcert/keyprovider.go
@@ -256,3 +256,3 @@
 	for i := range bytes {
-		b, err := strconv.ParseInt(thumbprint[i*2:(i*2)+2], 16, 32)
+		b, err := strconv.ParseInt(thumbprint[i*2:(i*2)+2], 16, 8)
 		if err != nil {
@@ -260,2 +260,5 @@
 		}
+		if b < 0 || b > 255 {
+			panic(fmt.Errorf("Parsed value out of byte range: %d", b))
+		}
 		bytes[i] = byte(b)
EOF
@@ -256,3 +256,3 @@
for i := range bytes {
b, err := strconv.ParseInt(thumbprint[i*2:(i*2)+2], 16, 32)
b, err := strconv.ParseInt(thumbprint[i*2:(i*2)+2], 16, 8)
if err != nil {
@@ -260,2 +260,5 @@
}
if b < 0 || b > 255 {
panic(fmt.Errorf("Parsed value out of byte range: %d", b))
}
bytes[i] = byte(b)
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.