[Cryptech-Commits] [sw/libhal] 02/03: Silly macro bugs.

git at cryptech.is git at cryptech.is
Wed Sep 13 15:57:00 UTC 2017


This is an automated email from the git hooks/post-receive script.

sra at hactrn.net pushed a commit to branch systolic_crt
in repository sw/libhal.

commit ae2985215d2329ac9663bbbedd925ec1b61cfaa1
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Tue Sep 12 10:19:27 2017 -0400

    Silly macro bugs.
---
 rsa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rsa.c b/rsa.c
index e414e93..24dc66f 100644
--- a/rsa.c
+++ b/rsa.c
@@ -895,7 +895,7 @@ hal_error_t hal_rsa_private_key_to_der_extra_maybe(const hal_rsa_key_t * const k
 #define _(x,y,z)                                                        \
   if ((key->flags & z) != 0) {                                          \
     size_t n = 0;                                                       \
-    if ((err = hal_asn1_encode_HEADER(x, sizeof(key->y), NULL,          \
+    if ((err = hal_asn1_encode_header(x, sizeof(key->y), NULL,          \
                                       &n, 0)) != HAL_OK)                \
       return err;                                                       \
     vlen += n + sizeof(key->y);                                         \
@@ -1007,7 +1007,7 @@ hal_error_t hal_rsa_private_key_from_der(hal_rsa_key_t **key_,
 #undef _
 
 #define _(x,y,z)                                                        \
-  if (hal_asn1_peek(d, vlen, x) {                                       \
+  if (hal_asn1_peek(x, d, vlen)) {                                      \
     size_t hl = 0, vl = 0;                                              \
     if ((err = hal_asn1_decode_header(x, d, vlen, &hl, &vl)) != HAL_OK) \
       return err;                                                       \



More information about the Commits mailing list