Commit 63ed82f
committed
refactor(crypto): remove System.Security.Cryptography refs, use BouncyCastle
Per the project's crypto policy: all certificate/key/hash handling must
use BouncyCastle, never BCL System.Security.Cryptography. Two legacy
violations remained:
- ExtractSerialFromPem in CERTInextCAPlugin.cs used X509Certificate2 to
parse a cert's serial number for audit logging. Replaced with
Org.BouncyCastle.X509.X509CertificateParser; output is the same
uppercase-hex serial format the BCL produced via .SerialNumber.
Side benefit: silences the SYSLIB0057 warning that X509Certificate2's
byte[] constructor produces on net10.0.
- ComputeAuthKey in CERTInextClient.cs used SHA256.HashData to derive the
CERTInext request authKey. Replaced with
Org.BouncyCastle.Crypto.Digests.Sha256Digest. Bytes-out are identical
to the BCL implementation by construction (both are stock SHA-256), so
the wire-level authKey is unchanged. Verified live against the
sandbox: Ping/GetProductDetails/ListOrders all PASS, meaning the new
authKey continues to authenticate.
Removed the now-unused `using System.Security.Cryptography;` from
CERTInextClient.cs.
146/146 unit tests pass; live Ping/Sync verifies the wire-level behaviour
is unchanged.1 parent dd82989 commit 63ed82f
2 files changed
Lines changed: 18 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1660 | 1660 | | |
1661 | 1661 | | |
1662 | 1662 | | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
1663 | 1666 | | |
1664 | 1667 | | |
1665 | 1668 | | |
| |||
1677 | 1680 | | |
1678 | 1681 | | |
1679 | 1682 | | |
1680 | | - | |
1681 | | - | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
1682 | 1690 | | |
1683 | 1691 | | |
1684 | 1692 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
1031 | 1030 | | |
1032 | 1031 | | |
1033 | 1032 | | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
1034 | 1036 | | |
1035 | 1037 | | |
1036 | 1038 | | |
1037 | 1039 | | |
1038 | | - | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
1039 | 1045 | | |
1040 | 1046 | | |
1041 | 1047 | | |
| |||
0 commit comments