Implement internally opaque bn access from asn1
authorMatt Caswell <matt@openssl.org>
Fri, 31 Oct 2014 00:01:18 +0000 (00:01 +0000)
committerMatt Caswell <matt@openssl.org>
Mon, 8 Dec 2014 21:40:26 +0000 (21:40 +0000)
Reviewed-by: Tim Hudson <tjh@openssl.org>
crypto/asn1/Makefile
crypto/asn1/t_pkey.c

index 4ea6fb80ff4185fdd0d5f478e5e9b967ef2591d1..a7b6c353965f9c47f60c9e7b763e139c9ef26948 100644 (file)
@@ -612,7 +612,7 @@ t_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 t_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 t_pkey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
 t_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
-t_pkey.o: ../cryptlib.h t_pkey.c
+t_pkey.o: ../cryptlib.h ../include/internal/bn_int.h t_pkey.c
 t_req.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
 t_req.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
 t_req.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
index 9dd18f65793733798a5ee62e0f812c44e18544b6..44f7183046efac22d65564502142f6042cc0bda1 100644 (file)
@@ -60,7 +60,7 @@
 #include "cryptlib.h"
 #include <openssl/objects.h>
 #include <openssl/buffer.h>
-#include <openssl/bn.h>
+#include "internal/bn_int.h"
 
 int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num,
                        unsigned char *buf, int off)
@@ -82,8 +82,8 @@ int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num,
        if (BN_num_bytes(num) <= BN_BYTES)
                {
                if (BIO_printf(bp,"%s %s%lu (%s0x%lx)\n",number,neg,
-                       (unsigned long)num->d[0],neg,(unsigned long)num->d[0])
-                       <= 0) return(0);
+                       (unsigned long)bn_get_words(num)[0],neg,
+                       (unsigned long)bn_get_words(num)[0])<= 0) return(0);
                }
        else
                {