Browse Source

Use the results of crypto_box_curve25519xsalsa20poly1305_beforenm and crypto_scalarmult_curve25519 to avoid warnings

Caleb James DeLisle 3 years ago
parent
commit
e54b3e4791
1 changed files with 3 additions and 2 deletions
  1. 3 2
      crypto/CryptoAuth.c

+ 3 - 2
crypto/CryptoAuth.c

@@ -86,7 +86,8 @@ static inline void getSharedSecret(uint8_t outputSecret[32],
                                    struct Log* logger)
 {
     if (passwordHash == NULL) {
-        crypto_box_curve25519xsalsa20poly1305_beforenm(outputSecret, herPublicKey, myPrivateKey);
+        Assert_true(!crypto_box_curve25519xsalsa20poly1305_beforenm(
+            outputSecret, herPublicKey, myPrivateKey));
     } else {
         union {
             struct {
@@ -96,7 +97,7 @@ static inline void getSharedSecret(uint8_t outputSecret[32],
             uint8_t bytes[64];
         } buff;
 
-        crypto_scalarmult_curve25519(buff.components.key, myPrivateKey, herPublicKey);
+        Assert_true(!crypto_scalarmult_curve25519(buff.components.key, myPrivateKey, herPublicKey));
         Bits_memcpy(buff.components.passwd, passwordHash, 32);
         crypto_hash_sha256(outputSecret, buff.bytes, 64);
     }