Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Commit

Permalink
Examples fix for cellular LENA-R8: include line endings in PEM certif…
Browse files Browse the repository at this point in the history
…icates. (#1171)

The cellular LENA-R8 module requires line-endings in PEM-format files, the only cellular module to require this.  The certificate arrays used by the secure sockets examples did not include line endings and hence would fail.  This wasn't noticed because the original LENA-R8 FW version (likely the engineering sample version) used when the examples were first run did not have this requirement and, in the case of the examples, we only write the certificate files if the hash doesn't match, since that is the best usage pattern; this is not a hole in testing because the security credentials tests _do_ test writing the certificate files and the test certificates files used there _do_ include line endings in the PEM-format files, so all is good.

Our thanks to mos216 for highlighting this.
  • Loading branch information
RobMeades authored May 28, 2024
1 parent b645c90 commit 7590200
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions example/sockets/credentials_tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,20 @@
/** A client certificate, generated for use with the uxblib echo
* server.
*/
const char *gpUEchoServerClientCertPem = "-----BEGIN CERTIFICATE-----"
"MIICSjCCAdACFD+js1Fht6STx4lF3zGisrnThT4iMAoGCCqGSM49BAMDMIGFMQsw"
"CQYDVQQGEwJVUzELMAkGA1UECAwCV0ExEDAOBgNVBAcMB1RoYWx3aWwxDzANBgNV"
"BAoMBnUtYmxveDELMAkGA1UECwwCY2ExFzAVBgNVBAMMDnd3dy51LWJsb3guY29t"
"MSAwHgYJKoZIhvcNAQkBFhF1YnhsaWJAdS1ibG94LmNvbTAgFw0yMzA3MDkwODI3"
"NDBaGA8yMTIzMDYxNTA4Mjc0MFowgYkxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJX"
"QTEQMA4GA1UEBwwHVGhhbHdpbDEPMA0GA1UECgwGdS1ibG94MQ8wDQYDVQQLDAZj"
"bGllbnQxFzAVBgNVBAMMDnd3dy51LWJsb3guY29tMSAwHgYJKoZIhvcNAQkBFhF1"
"YnhsaWJAdS1ibG94LmNvbTB2MBAGByqGSM49AgEGBSuBBAAiA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MHnXjrpe0jEk8\n"
"bTULtydY8Jyf9c+DAjBMEdAEODaOp5Vn02ZOkKtbm91R6rFS1IZTFJ2MQCALG50C\n"
"GHviROz1O6YfRcRFTks=\n"
"-----END CERTIFICATE-----";

/** The hash of gpUEchoServerClientCertPem once stored on the module.
Expand All @@ -70,11 +70,11 @@ const char gUEchoServerClientCertHash[] = {0x33, 0x5f, 0x89, 0x2f, 0x59, 0x84, 0

/** The private key to go with uEchoServerClientCertPem.
*/
const char *gpUEchoServerClientKeyPem = "-----BEGIN EC PRIVATE KEY-----"
"MIGkAgEBBDBxQnFRM8oo6gCjmfNNgTdfUQreohEDs1NFIOq84DO3120rKI4Ypf7h"
"xog10lSfhhOgBwYFK4EEACKhZANiAAQKZjWC5UfAq0vTAKHEF/m1FOPtRJJk+tW3"
"IbOqX/UVb724Gy5MNoJP0qPLz4n6OopiXI1rXoiAcsWCihUiMoIc/6NIY5qQ89V6"
"GD7RhDa8/3ciEj9+WRZPbESWeKUl9bg="
const char *gpUEchoServerClientKeyPem = "-----BEGIN EC PRIVATE KEY-----\n"
"MIGkAgEBBDBxQnFRM8oo6gCjmfNNgTdfUQreohEDs1NFIOq84DO3120rKI4Ypf7h\n"
"xog10lSfhhOgBwYFK4EEACKhZANiAAQKZjWC5UfAq0vTAKHEF/m1FOPtRJJk+tW3\n"
"IbOqX/UVb724Gy5MNoJP0qPLz4n6OopiXI1rXoiAcsWCihUiMoIc/6NIY5qQ89V6\n"
"GD7RhDa8/3ciEj9+WRZPbESWeKUl9bg=\n"
"-----END EC PRIVATE KEY-----";

/** The hash of gpUEchoServerClientKeyPem once stored on the module.
Expand All @@ -85,22 +85,22 @@ const char gUEchoServerClientKeyHash[] = {0x8f, 0xe6, 0xdd, 0xdb, 0x64, 0xb8, 0x

/** The CA certificate for the ubxlib echo server and the client.
*/
const char *gpUEchoServerCaCertPem = "-----BEGIN CERTIFICATE-----"
"MIICoTCCAiagAwIBAgIUXW8iJeCsbA3ygmXIT3wqxqtZla4w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wHVGhhbHdpbDEP\n"
"MA0GA1UECgwGdS1ibG94MQswCQYDVQQLDAJjYTEXMBUGA1UEAwwOd3d3LnUtYmxv\n"
"eC5jb20xIDAeBgkqhkiG9w0BCQEWEXVieGxpYkB1LWJsb3guY29tMCAXDTIzMDcw\n"
"OTA4MjY1NloYDzIxMjMwNjE1MDgyNjU2WjCBhTELMAkGA1UEBhMCVVMxCzAJBgNV\n"
"BAgMAldBMRAwDgYDVQQHDAdUaGFsd2lsMQ8wDQYDVQQKDAZ1LWJsb3gxCzAJBgNV\n"
"BAsMAmNhMRcwFQYDVQQDDA53d3cudS1ibG94LmNvbTEgMB4GCSqGSIb3DQEJARYR\n"
"dWJ4bGliQHUtYmxveC5jb20wdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAS5br7n7+wi\n"
"Mwp5h3BojVn+cH4oZN7ngyfadR961TJZsu/g2arYE8SJTVI+qzQC4KiBb+rTXQIY\n"
"k9sxEo+mTyJ4BWaVxoWOXjvALNRtyrbls6q36ttXoYsU5UAgNWJiH/ejUzBRMB0G\n"
"A1UdDgQWBBRKetSAT3SQ45r2l64eXK1vf8sTzDAfBgNVHSMEGDAWgBRKetSAT3SQ\n"
"45r2l64eXK1vf8sTzDAPBgNVHRMBAf8EBTADAQH/MAoGCCqGSM49BAMCA2kAMGYC\n"
"MQD7WrRzaAxBikIHPuoDZo7tAdA5Zsbg9axBPS+wm3mdKLGwWjdep2IWLmn/uuFE\n"
"VlwCMQDXxDnOuuc6p1nzmtrn9JHVE0/+HdeDj6KdnDWWtZJQsagHDAEmld8oEDlg\n"
"iDO9Bnw=\n"
"-----END CERTIFICATE-----";

/** The hash of gpUEchoServerCaCertPem once stored on the module.
Expand Down

0 comments on commit 7590200

Please sign in to comment.