diff --git a/provider/dropbox/dropbox.go b/provider/dropbox/dropbox.go index 9b6c2ed..c38bc5a 100644 --- a/provider/dropbox/dropbox.go +++ b/provider/dropbox/dropbox.go @@ -4,6 +4,7 @@ import ( "crypto/aes" "crypto/cipher" "crypto/rand" + "crypto/sha1" "encoding/base64" "encoding/json" "fmt" @@ -34,7 +35,10 @@ type TokenMap map[string]string // OAuth2DropboxConfig creates a oauth config func OAuth2DropboxConfig() *oauth2.Config { - o := obf{jkoq: []byte(ob)} + hasher := sha1.New() + hasher.Write([]byte(ob)) + ab := hasher.Sum(nil)[:16] + o := obf{jkoq: []byte(ab)} return &oauth2.Config{ ClientID: o.de("cJ21xYBoKXFzTY3vu1A3Hda4dp57jYMrTs1dbmdf9g=="), ClientSecret: o.de("Ziif+YX0+cnsKuO8P9ZBXhQwjs/IL/MwmdUnTbnZiQ=="), diff --git a/provider/googledrive/googledrive.go b/provider/googledrive/googledrive.go index e913468..071c831 100644 --- a/provider/googledrive/googledrive.go +++ b/provider/googledrive/googledrive.go @@ -5,6 +5,7 @@ import ( "crypto/aes" "crypto/cipher" "crypto/rand" + "crypto/sha1" "encoding/base64" "encoding/json" "fmt" @@ -61,7 +62,10 @@ var ( // OAuth2GoogleDriveConfig ... func OAuth2GoogleDriveConfig() *oauth2.Config { - k := obf{jkoq: []byte(ob)} + hasher := sha1.New() + hasher.Write([]byte(ob)) + ab := hasher.Sum(nil)[:16] + k := obf{jkoq: []byte(ab)} x := k.de(y) b := []byte(`{"installed":{"client_id":"26115953275-7971erj532s8d98vlso25467iudikbvf.apps.googleusercontent.com","project_id":"sharecmd-223413","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://www.googleapis.com/oauth2/v3/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"` + x + `","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]}}`) //config, err := google.ConfigFromJSON(b, drive.DriveMetadataScope)