Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: AzureStor
Title: Storage Management in 'Azure'
Version: 3.7.1
Version: 3.7.2
Authors@R: c(
person("Hong", "Ooi", , "hongooi73@gmail.com", role = c("aut", "cre")),
person("Microsoft", role="cph")
Expand Down Expand Up @@ -31,4 +31,4 @@ Suggests:
processx,
uuid
Roxygen: list(markdown=TRUE, r6=FALSE, old_usage=TRUE)
RoxygenNote: 7.3.2
Config/roxygen2/version: 8.1.0
10 changes: 6 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ export(upload_azure_file)
export(upload_blob)
export(upload_to_url)
import(AzureRMR)
importFrom(utils,URLencode)
importFrom(utils,glob2rx)
importFrom(utils,modifyList)
importFrom(utils,packageVersion)
importFrom(utils,
URLencode,
glob2rx,
modifyList,
packageVersion
)
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# AzureStor 3.7.2

- Storage account key authentication and SAS generation will now always fail with a key that is invalid Base64-encoded, rather than generating a bad SAS. Also fixes #147.

# AzureStor 3.7.1

- Update documentation links for CRAN
Expand Down
4 changes: 2 additions & 2 deletions R/sas.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
#' [Create a service SAS](https://learn.microsoft.com/en-us/rest/api/storageservices/create-service-sas)
#'
#' @examples
#' \dontrun{
#'
#' # account SAS valid for 7 days
#' get_account_sas("mystorage", "access_key", start=Sys.Date(), expiry=Sys.Date() + 7)
#'
Expand All @@ -72,8 +74,6 @@
#' # read/write service SAS for a blob
#' get_service_sas(endp, "containername/blobname", permissions="rw")
#'
#' \dontrun{
#'
#' # user delegation key valid for 24 hours
#' token <- AzureRMR::get_azure_token("https://storage.azure.com", "mytenant", "app_id")
#' endp <- storage_endpoint("https://mystorage.blob.core.windows.net", token=token)
Expand Down
7 changes: 6 additions & 1 deletion R/storage_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,12 @@ render_xml <- function(lst)

sign_sha256 <- function(string, key)
{
openssl::base64_encode(openssl::sha256(charToRaw(string), openssl::base64_decode(key)))
# throw error on all invalid keys (consistent with behaviour in openssl 2.5.0)
key_decoded <- try(openssl::base64_decode(key))
if(inherits(key_decoded, "try-error") || length(key_decoded) == 0)
stop("Invalid storage account key, must be Base64 encoded", call.=FALSE)

openssl::base64_encode(openssl::sha256(charToRaw(string), key_decoded))
}


Expand Down
2 changes: 1 addition & 1 deletion man/adls_filesystem.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/blob_container.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/sas.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/storage_endpoint.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading