canonicalization

Canonical Redirect with classic ASP shows site folder

匆匆过客 提交于 2020-07-09 17:03:20
问题 If pointed to http://domain.com it redirects to http://www.domain.com/thesite/index.asp which is the actual location. No matter the page, it always appends the actual folder path. ive been using this script for canonical redirection, included in every page. If InStr(Request.ServerVariables("SERVER_NAME"),"www") = 0 Then Response.Status="301 Moved Permanently" Response.AddHeader "Location","http://www." &_ Request.ServerVariables("HTTP_HOST")&_ Request.ServerVariables("SCRIPT_NAME") End if I

Using a HashSet to canonicalize objects in Rust

99封情书 提交于 2020-03-16 06:27:48
问题 As an educational exercise, I'm looking at porting cvs-fast-export to Rust. Its basic mode of operation is to parse a number of CVS master files into a intermediate form, and then to analyse the intermediate form with the goal of transforming it into a git fast-export stream. One of the things that is done when parsing is to convert common parts of the intermediate form into a canonical representation. A motivating example is commit authors. A CVS repository may have hundreds of thousands of

Why does my canonicalized path get prefixed with \\?\

杀马特。学长 韩版系。学妹 提交于 2020-01-05 02:27:31
问题 I'm working on a personal project that I was trying to solve via canonicalizing a relative path in Rust. However, whenever I do so, the new path gets prefixed with a strange \\?\ sequence. For example, something as simple as: let p = fs::canonicalize(".").unwrap(); println!("{}", p.display()); will result in something like the following output: \\?\C:\Users\[...]\rustprojects\projectname This isn't a particular problem because I can accomplish what I'm attempting in other ways. However, it

Change canonicalization algorithm with WCF

廉价感情. 提交于 2020-01-05 00:03:13
问题 I am trying to call a webservice using WCF with a certificate to sign the message. The server only supports the following canonicalization algorithm : 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments' By default, WCF uses 'http://www.w3.org/2001/10/xml-exc-c14n#' Since I couldn't configure it with the config file, I created a custom binding in which I set a custom SecurityAlgorithmSuite to force WCF to use the canonicalization algorithm expected by the service. Here is my custom

Change canonicalization algorithm with WCF

馋奶兔 提交于 2020-01-05 00:03:10
问题 I am trying to call a webservice using WCF with a certificate to sign the message. The server only supports the following canonicalization algorithm : 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments' By default, WCF uses 'http://www.w3.org/2001/10/xml-exc-c14n#' Since I couldn't configure it with the config file, I created a custom binding in which I set a custom SecurityAlgorithmSuite to force WCF to use the canonicalization algorithm expected by the service. Here is my custom

Generating an XML document hash in C#

廉价感情. 提交于 2020-01-01 04:46:05
问题 What's the best way to go about hashing an XML document in C#? I'd like to hash an XML document so that I can tell if it was manually changed from when it was generated. I'm not using this for security--it's OK if someone changes the XML, and changes the hash to match. For example, I'd hash the child nodes of the root and store the hash as an attribute of the root: <RootNode Hash="abc123"> <!-- Content to hash here --> </RootNode> 回答1: .NET has classes that implement the XML digital signature

Using Xpath With Default Namespace in C# for Canonicalisation

元气小坏坏 提交于 2019-12-24 14:21:49
问题 I'm trying to apply the C14N transform to some generated XML. It appears I can't use LINQ to retrieve the nodes to perform the canonicalisation so I have to go 'old school' with the DOM but I think I'm falling foul of the default namespace. Here is a sample of my code. static void Main(string[] args) { XmlDocument xDoc = new XmlDocument(); // Load some test xml string path = @"..\..\TestFiles\Test_1.xml"; if (File.Exists(path) == true) { xDoc.PreserveWhitespace = true; using (FileStream fs =

How to canonicalize XML in javascript?

时间秒杀一切 提交于 2019-12-24 11:21:54
问题 Is there a JavaScript library for XML canonicalization with support for Exclusive XML Canonicalization? If there is no library for that, how can I canonicalize XML in a Node.js library with minimal requirements (no Ruby or Java)? 回答1: As far as I know there are no XML libraries for Node.js that do C14n yet, I looked at this a while back and the easiest route seemed to be to add the functionality to the libxml library: https://github.com/polotek/libxmljs 回答2: You an use xml-crypto to sign XML

ESAPI canonicalize malforming url

ぐ巨炮叔叔 提交于 2019-12-22 12:38:58
问题 We have an application that accepts URLs from users. This data needs validation, and we're using ESAPI for this purpose. However, we're struggling with URLs containing ampersands. The problem appears when ESAPI canonicalizes the data before validation. &pid=123 in the URL turns into πd=123 for example. Since π is not whitelisted, the validation fails. I've tried encoding it, but ESAPI is smarter than that and does canonicalization to avoid double encoding and mixed encoding. I'm a bit stumped

C# Calculate and verify SHA256 value for SEPA (XML) paymentfile

前提是你 提交于 2019-12-21 20:24:40
问题 i am struggling with the same issue like Markus Dreyer: C# Calculate SHA256 value for SEPA (XML) paymentfile According to the DFÜ Agreement i have to calculate a sha256 hash value: The hash value is created using the entire contained document, including the opening and closing tag. The document is canonicalized according to Canonical XML, version 1.0. (http://www.w3.org/TR/2001/REC-xml-c14n-20010315). In the case of included documents, the canonisation has also to be executed accord-ing to