File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -80,15 +80,18 @@ private SecurityHeaderType GetSecurityHeaderType()
80
80
byte [ ] hashedPassword ;
81
81
hashedPassword = GetSHA1 ( _credentials . SoapSecurity . Password ) ;
82
82
83
- string concatednatedDigestInput = string . Concat ( nonce , creationDate , Encoding . Default . GetString ( hashedPassword ) ) ;
83
+ // https://github.com/povilaspanavas/RoyalMailShippingApiV2/issues/1
84
+ // after hippasus raised issue, I've changed the encoding (previously was using Default). Ran the tests and it worked
85
+ var encoding = Encoding . GetEncoding ( "iso-8859-1" ) ;
86
+ string concatednatedDigestInput = string . Concat ( nonce , creationDate , encoding . GetString ( hashedPassword ) ) ;
84
87
byte [ ] digest ;
85
88
digest = GetSHA1 ( concatednatedDigestInput ) ;
86
89
87
90
string passwordDigest ;
88
91
passwordDigest = Convert . ToBase64String ( digest ) ;
89
92
90
93
string encodedNonce ;
91
- encodedNonce = Convert . ToBase64String ( Encoding . Default . GetBytes ( nonce ) ) ;
94
+ encodedNonce = Convert . ToBase64String ( encoding . GetBytes ( nonce ) ) ;
92
95
93
96
XmlDocument doc = new XmlDocument ( ) ;
94
97
using ( XmlWriter writer = doc . CreateNavigator ( ) . AppendChild ( ) )
You can’t perform that action at this time.
0 commit comments