summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorjsing <>2015-07-29 14:58:34 +0000
committerjsing <>2015-07-29 14:58:34 +0000
commit4b2596fb0f28cb59c8918b16cdae591454312175 (patch)
treeffda12d1155f37910342cc3f090b8425ad4cf03a /src/lib
parentef1330e743f37f67eea11df4f4993267e06531dd (diff)
downloadopenbsd-4b2596fb0f28cb59c8918b16cdae591454312175.tar.gz
openbsd-4b2596fb0f28cb59c8918b16cdae591454312175.tar.bz2
openbsd-4b2596fb0f28cb59c8918b16cdae591454312175.zip
Expand obsolete M_ASN1.*(cmp|dup|print|set) macros - no change in generated
assembly. ok bcook@
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/asn1/a_bitstr.c4
-rw-r--r--src/lib/libcrypto/asn1/a_int.c4
-rw-r--r--src/lib/libcrypto/asn1/a_octet.c8
-rw-r--r--src/lib/libcrypto/asn1/evp_asn1.c4
-rw-r--r--src/lib/libcrypto/asn1/t_req.c4
-rw-r--r--src/lib/libcrypto/ec/ec_asn1.c10
-rw-r--r--src/lib/libcrypto/pkcs12/p12_mutl.c4
-rw-r--r--src/lib/libcrypto/pkcs7/pk7_doit.c6
-rw-r--r--src/lib/libcrypto/pkcs7/pk7_lib.c6
-rw-r--r--src/lib/libcrypto/ts/ts_lib.c4
-rw-r--r--src/lib/libcrypto/ts/ts_rsp_utils.c4
-rw-r--r--src/lib/libcrypto/x509/x509_cmp.c4
-rw-r--r--src/lib/libcrypto/x509/x509_set.c8
-rw-r--r--src/lib/libcrypto/x509/x509_v3.c4
-rw-r--r--src/lib/libcrypto/x509/x509cset.c10
-rw-r--r--src/lib/libcrypto/x509v3/v3_akey.c4
-rw-r--r--src/lib/libcrypto/x509v3/v3_alt.c4
-rw-r--r--src/lib/libcrypto/x509v3/v3_prn.c4
-rw-r--r--src/lib/libcrypto/x509v3/v3_skey.c4
-rw-r--r--src/lib/libcrypto/x509v3/v3_sxnet.c8
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_bitstr.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_int.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_octet.c8
-rw-r--r--src/lib/libssl/src/crypto/asn1/evp_asn1.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/t_req.c4
-rw-r--r--src/lib/libssl/src/crypto/ec/ec_asn1.c10
-rw-r--r--src/lib/libssl/src/crypto/pkcs12/p12_mutl.c4
-rw-r--r--src/lib/libssl/src/crypto/pkcs7/pk7_doit.c6
-rw-r--r--src/lib/libssl/src/crypto/pkcs7/pk7_lib.c6
-rw-r--r--src/lib/libssl/src/crypto/ts/ts_lib.c4
-rw-r--r--src/lib/libssl/src/crypto/ts/ts_rsp_utils.c4
-rw-r--r--src/lib/libssl/src/crypto/x509/x509_cmp.c4
-rw-r--r--src/lib/libssl/src/crypto/x509/x509_set.c8
-rw-r--r--src/lib/libssl/src/crypto/x509/x509_v3.c4
-rw-r--r--src/lib/libssl/src/crypto/x509/x509cset.c10
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_akey.c4
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_alt.c4
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_prn.c4
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_skey.c4
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_sxnet.c8
40 files changed, 108 insertions, 108 deletions
diff --git a/src/lib/libcrypto/asn1/a_bitstr.c b/src/lib/libcrypto/asn1/a_bitstr.c
index 5575a5c939..c0259ad815 100644
--- a/src/lib/libcrypto/asn1/a_bitstr.c
+++ b/src/lib/libcrypto/asn1/a_bitstr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_bitstr.c,v 1.21 2015/07/19 18:29:31 miod Exp $ */ 1/* $OpenBSD: a_bitstr.c,v 1.22 2015/07/29 14:58:34 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -65,7 +65,7 @@
65int 65int
66ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len) 66ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len)
67{ 67{
68 return M_ASN1_BIT_STRING_set(x, d, len); 68 return ASN1_STRING_set(x, d, len);
69} 69}
70 70
71int 71int
diff --git a/src/lib/libcrypto/asn1/a_int.c b/src/lib/libcrypto/asn1/a_int.c
index 7d17aae2a2..6a378c0884 100644
--- a/src/lib/libcrypto/asn1/a_int.c
+++ b/src/lib/libcrypto/asn1/a_int.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_int.c,v 1.27 2015/07/19 18:29:31 miod Exp $ */ 1/* $OpenBSD: a_int.c,v 1.28 2015/07/29 14:58:34 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -66,7 +66,7 @@
66ASN1_INTEGER * 66ASN1_INTEGER *
67ASN1_INTEGER_dup(const ASN1_INTEGER *x) 67ASN1_INTEGER_dup(const ASN1_INTEGER *x)
68{ 68{
69 return M_ASN1_INTEGER_dup(x); 69 return ASN1_STRING_dup(x);
70} 70}
71 71
72int 72int
diff --git a/src/lib/libcrypto/asn1/a_octet.c b/src/lib/libcrypto/asn1/a_octet.c
index 8c57592174..d998675d3f 100644
--- a/src/lib/libcrypto/asn1/a_octet.c
+++ b/src/lib/libcrypto/asn1/a_octet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_octet.c,v 1.9 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: a_octet.c,v 1.10 2015/07/29 14:58:34 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -63,17 +63,17 @@
63ASN1_OCTET_STRING * 63ASN1_OCTET_STRING *
64ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *x) 64ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *x)
65{ 65{
66 return M_ASN1_OCTET_STRING_dup(x); 66 return ASN1_STRING_dup(x);
67} 67}
68 68
69int 69int
70ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a, const ASN1_OCTET_STRING *b) 70ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a, const ASN1_OCTET_STRING *b)
71{ 71{
72 return M_ASN1_OCTET_STRING_cmp(a, b); 72 return ASN1_STRING_cmp(a, b);
73} 73}
74 74
75int 75int
76ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *x, const unsigned char *d, int len) 76ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *x, const unsigned char *d, int len)
77{ 77{
78 return M_ASN1_OCTET_STRING_set(x, d, len); 78 return ASN1_STRING_set(x, d, len);
79} 79}
diff --git a/src/lib/libcrypto/asn1/evp_asn1.c b/src/lib/libcrypto/asn1/evp_asn1.c
index 5e21f3c8ae..5ee4751763 100644
--- a/src/lib/libcrypto/asn1/evp_asn1.c
+++ b/src/lib/libcrypto/asn1/evp_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_asn1.c,v 1.13 2014/07/12 16:03:36 miod Exp $ */ 1/* $OpenBSD: evp_asn1.c,v 1.14 2015/07/29 14:58:34 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -70,7 +70,7 @@ ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len)
70 70
71 if ((os = M_ASN1_OCTET_STRING_new()) == NULL) 71 if ((os = M_ASN1_OCTET_STRING_new()) == NULL)
72 return (0); 72 return (0);
73 if (!M_ASN1_OCTET_STRING_set(os, data, len)) { 73 if (!ASN1_STRING_set(os, data, len)) {
74 M_ASN1_OCTET_STRING_free(os); 74 M_ASN1_OCTET_STRING_free(os);
75 return (0); 75 return (0);
76 } 76 }
diff --git a/src/lib/libcrypto/asn1/t_req.c b/src/lib/libcrypto/asn1/t_req.c
index 51f711acf7..8db456708a 100644
--- a/src/lib/libcrypto/asn1/t_req.c
+++ b/src/lib/libcrypto/asn1/t_req.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t_req.c,v 1.17 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: t_req.c,v 1.18 2015/07/29 14:58:34 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -239,7 +239,7 @@ get_next:
239 goto err; 239 goto err;
240 if (!X509V3_EXT_print(bp, ex, cflag, 16)) { 240 if (!X509V3_EXT_print(bp, ex, cflag, 16)) {
241 BIO_printf(bp, "%16s", ""); 241 BIO_printf(bp, "%16s", "");
242 M_ASN1_OCTET_STRING_print(bp, ex->value); 242 ASN1_STRING_print(bp, ex->value);
243 } 243 }
244 if (BIO_write(bp, "\n", 1) <= 0) 244 if (BIO_write(bp, "\n", 1) <= 0)
245 goto err; 245 goto err;
diff --git a/src/lib/libcrypto/ec/ec_asn1.c b/src/lib/libcrypto/ec/ec_asn1.c
index 0ee949134e..2e7e1746fa 100644
--- a/src/lib/libcrypto/ec/ec_asn1.c
+++ b/src/lib/libcrypto/ec/ec_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_asn1.c,v 1.15 2015/07/25 14:36:39 jsing Exp $ */ 1/* $OpenBSD: ec_asn1.c,v 1.16 2015/07/29 14:58:34 jsing Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project. 3 * Written by Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -858,8 +858,8 @@ ec_asn1_group2curve(const EC_GROUP * group, X9_62_CURVE * curve)
858 } 858 }
859 859
860 /* set a and b */ 860 /* set a and b */
861 if (!M_ASN1_OCTET_STRING_set(curve->a, a_buf, len_1) || 861 if (!ASN1_STRING_set(curve->a, a_buf, len_1) ||
862 !M_ASN1_OCTET_STRING_set(curve->b, b_buf, len_2)) { 862 !ASN1_STRING_set(curve->b, b_buf, len_2)) {
863 ECerr(EC_F_EC_ASN1_GROUP2CURVE, ERR_R_ASN1_LIB); 863 ECerr(EC_F_EC_ASN1_GROUP2CURVE, ERR_R_ASN1_LIB);
864 goto err; 864 goto err;
865 } 865 }
@@ -1447,7 +1447,7 @@ i2d_ECPrivateKey(EC_KEY * a, unsigned char **out)
1447 ECerr(EC_F_I2D_ECPRIVATEKEY, ERR_R_BN_LIB); 1447 ECerr(EC_F_I2D_ECPRIVATEKEY, ERR_R_BN_LIB);
1448 goto err; 1448 goto err;
1449 } 1449 }
1450 if (!M_ASN1_OCTET_STRING_set(priv_key->privateKey, buffer, buf_len)) { 1450 if (!ASN1_STRING_set(priv_key->privateKey, buffer, buf_len)) {
1451 ECerr(EC_F_I2D_ECPRIVATEKEY, ERR_R_ASN1_LIB); 1451 ECerr(EC_F_I2D_ECPRIVATEKEY, ERR_R_ASN1_LIB);
1452 goto err; 1452 goto err;
1453 } 1453 }
@@ -1484,7 +1484,7 @@ i2d_ECPrivateKey(EC_KEY * a, unsigned char **out)
1484 } 1484 }
1485 priv_key->publicKey->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07); 1485 priv_key->publicKey->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07);
1486 priv_key->publicKey->flags |= ASN1_STRING_FLAG_BITS_LEFT; 1486 priv_key->publicKey->flags |= ASN1_STRING_FLAG_BITS_LEFT;
1487 if (!M_ASN1_BIT_STRING_set(priv_key->publicKey, buffer, 1487 if (!ASN1_STRING_set(priv_key->publicKey, buffer,
1488 buf_len)) { 1488 buf_len)) {
1489 ECerr(EC_F_I2D_ECPRIVATEKEY, ERR_R_ASN1_LIB); 1489 ECerr(EC_F_I2D_ECPRIVATEKEY, ERR_R_ASN1_LIB);
1490 goto err; 1490 goto err;
diff --git a/src/lib/libcrypto/pkcs12/p12_mutl.c b/src/lib/libcrypto/pkcs12/p12_mutl.c
index ac58f50ca7..00acf1f210 100644
--- a/src/lib/libcrypto/pkcs12/p12_mutl.c
+++ b/src/lib/libcrypto/pkcs12/p12_mutl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_mutl.c,v 1.19 2014/10/22 18:37:22 miod Exp $ */ 1/* $OpenBSD: p12_mutl.c,v 1.20 2015/07/29 14:58:34 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -160,7 +160,7 @@ PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen, unsigned char *salt,
160 PKCS12_R_MAC_GENERATION_ERROR); 160 PKCS12_R_MAC_GENERATION_ERROR);
161 return 0; 161 return 0;
162 } 162 }
163 if (!(M_ASN1_OCTET_STRING_set(p12->mac->dinfo->digest, mac, maclen))) { 163 if (!(ASN1_STRING_set(p12->mac->dinfo->digest, mac, maclen))) {
164 PKCS12err(PKCS12_F_PKCS12_SET_MAC, 164 PKCS12err(PKCS12_F_PKCS12_SET_MAC,
165 PKCS12_R_MAC_STRING_SET_ERROR); 165 PKCS12_R_MAC_STRING_SET_ERROR);
166 return 0; 166 return 0;
diff --git a/src/lib/libcrypto/pkcs7/pk7_doit.c b/src/lib/libcrypto/pkcs7/pk7_doit.c
index 2c69edf499..24bcebef61 100644
--- a/src/lib/libcrypto/pkcs7/pk7_doit.c
+++ b/src/lib/libcrypto/pkcs7/pk7_doit.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pk7_doit.c,v 1.35 2015/07/19 18:25:59 miod Exp $ */ 1/* $OpenBSD: pk7_doit.c,v 1.36 2015/07/29 14:58:34 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -417,7 +417,7 @@ pkcs7_cmp_ri(PKCS7_RECIP_INFO *ri, X509 *pcert)
417 pcert->cert_info->issuer); 417 pcert->cert_info->issuer);
418 if (ret) 418 if (ret)
419 return ret; 419 return ret;
420 return M_ASN1_INTEGER_cmp(pcert->cert_info->serialNumber, 420 return ASN1_STRING_cmp(pcert->cert_info->serialNumber,
421 ri->issuer_and_serial->serial); 421 ri->issuer_and_serial->serial);
422} 422}
423 423
@@ -856,7 +856,7 @@ PKCS7_dataFinal(PKCS7 *p7, BIO *bio)
856 goto err; 856 goto err;
857 if (!EVP_DigestFinal_ex(mdc, md_data, &md_len)) 857 if (!EVP_DigestFinal_ex(mdc, md_data, &md_len))
858 goto err; 858 goto err;
859 if (M_ASN1_OCTET_STRING_set(p7->d.digest->digest, md_data, 859 if (ASN1_STRING_set(p7->d.digest->digest, md_data,
860 md_len) == 0) 860 md_len) == 0)
861 goto err; 861 goto err;
862 } 862 }
diff --git a/src/lib/libcrypto/pkcs7/pk7_lib.c b/src/lib/libcrypto/pkcs7/pk7_lib.c
index 3eec92e29b..9f7e4f2dd3 100644
--- a/src/lib/libcrypto/pkcs7/pk7_lib.c
+++ b/src/lib/libcrypto/pkcs7/pk7_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pk7_lib.c,v 1.15 2015/03/19 14:00:22 tedu Exp $ */ 1/* $OpenBSD: pk7_lib.c,v 1.16 2015/07/29 14:58:34 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -380,7 +380,7 @@ PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey,
380 * things the ugly way. */ 380 * things the ugly way. */
381 M_ASN1_INTEGER_free(p7i->issuer_and_serial->serial); 381 M_ASN1_INTEGER_free(p7i->issuer_and_serial->serial);
382 if (!(p7i->issuer_and_serial->serial = 382 if (!(p7i->issuer_and_serial->serial =
383 M_ASN1_INTEGER_dup(X509_get_serialNumber(x509)))) 383 ASN1_STRING_dup(X509_get_serialNumber(x509))))
384 goto err; 384 goto err;
385 385
386 /* lets keep the pkey around for a while */ 386 /* lets keep the pkey around for a while */
@@ -545,7 +545,7 @@ PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509)
545 545
546 M_ASN1_INTEGER_free(p7i->issuer_and_serial->serial); 546 M_ASN1_INTEGER_free(p7i->issuer_and_serial->serial);
547 if (!(p7i->issuer_and_serial->serial = 547 if (!(p7i->issuer_and_serial->serial =
548 M_ASN1_INTEGER_dup(X509_get_serialNumber(x509)))) 548 ASN1_STRING_dup(X509_get_serialNumber(x509))))
549 return 0; 549 return 0;
550 550
551 pkey = X509_get_pubkey(x509); 551 pkey = X509_get_pubkey(x509);
diff --git a/src/lib/libcrypto/ts/ts_lib.c b/src/lib/libcrypto/ts/ts_lib.c
index f08bb8701d..ac5f65df94 100644
--- a/src/lib/libcrypto/ts/ts_lib.c
+++ b/src/lib/libcrypto/ts/ts_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_lib.c,v 1.8 2014/07/11 08:44:49 jsing Exp $ */ 1/* $OpenBSD: ts_lib.c,v 1.9 2015/07/29 14:58:34 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
4 */ 4 */
@@ -117,7 +117,7 @@ TS_ext_print_bio(BIO *bio, const STACK_OF(X509_EXTENSION) *extensions)
117 BIO_printf(bio, ": %s\n", critical ? "critical" : ""); 117 BIO_printf(bio, ": %s\n", critical ? "critical" : "");
118 if (!X509V3_EXT_print(bio, ex, 0, 4)) { 118 if (!X509V3_EXT_print(bio, ex, 0, 4)) {
119 BIO_printf(bio, "%4s", ""); 119 BIO_printf(bio, "%4s", "");
120 M_ASN1_OCTET_STRING_print(bio, ex->value); 120 ASN1_STRING_print(bio, ex->value);
121 } 121 }
122 BIO_write(bio, "\n", 1); 122 BIO_write(bio, "\n", 1);
123 } 123 }
diff --git a/src/lib/libcrypto/ts/ts_rsp_utils.c b/src/lib/libcrypto/ts/ts_rsp_utils.c
index 0d05814297..39eb2a2963 100644
--- a/src/lib/libcrypto/ts/ts_rsp_utils.c
+++ b/src/lib/libcrypto/ts/ts_rsp_utils.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_rsp_utils.c,v 1.4 2014/07/11 08:44:49 jsing Exp $ */ 1/* $OpenBSD: ts_rsp_utils.c,v 1.5 2015/07/29 14:58:34 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
4 */ 4 */
@@ -200,7 +200,7 @@ TS_TST_INFO_set_time(TS_TST_INFO *a, const ASN1_GENERALIZEDTIME *gtime)
200 200
201 if (a->time == gtime) 201 if (a->time == gtime)
202 return 1; 202 return 1;
203 new_time = M_ASN1_GENERALIZEDTIME_dup(gtime); 203 new_time = ASN1_STRING_dup(gtime);
204 if (new_time == NULL) { 204 if (new_time == NULL) {
205 TSerr(TS_F_TS_TST_INFO_SET_TIME, ERR_R_MALLOC_FAILURE); 205 TSerr(TS_F_TS_TST_INFO_SET_TIME, ERR_R_MALLOC_FAILURE);
206 return 0; 206 return 0;
diff --git a/src/lib/libcrypto/x509/x509_cmp.c b/src/lib/libcrypto/x509/x509_cmp.c
index 030e29bde7..407e1e07ad 100644
--- a/src/lib/libcrypto/x509/x509_cmp.c
+++ b/src/lib/libcrypto/x509/x509_cmp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_cmp.c,v 1.25 2014/09/26 19:31:09 miod Exp $ */ 1/* $OpenBSD: x509_cmp.c,v 1.26 2015/07/29 14:58:34 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -76,7 +76,7 @@ X509_issuer_and_serial_cmp(const X509 *a, const X509 *b)
76 76
77 ai = a->cert_info; 77 ai = a->cert_info;
78 bi = b->cert_info; 78 bi = b->cert_info;
79 i = M_ASN1_INTEGER_cmp(ai->serialNumber, bi->serialNumber); 79 i = ASN1_STRING_cmp(ai->serialNumber, bi->serialNumber);
80 if (i) 80 if (i)
81 return (i); 81 return (i);
82 return (X509_NAME_cmp(ai->issuer, bi->issuer)); 82 return (X509_NAME_cmp(ai->issuer, bi->issuer));
diff --git a/src/lib/libcrypto/x509/x509_set.c b/src/lib/libcrypto/x509/x509_set.c
index 3be557cbc0..c6160b90b0 100644
--- a/src/lib/libcrypto/x509/x509_set.c
+++ b/src/lib/libcrypto/x509/x509_set.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_set.c,v 1.9 2014/07/11 08:44:49 jsing Exp $ */ 1/* $OpenBSD: x509_set.c,v 1.10 2015/07/29 14:58:34 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -84,7 +84,7 @@ X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial)
84 return (0); 84 return (0);
85 in = x->cert_info->serialNumber; 85 in = x->cert_info->serialNumber;
86 if (in != serial) { 86 if (in != serial) {
87 in = M_ASN1_INTEGER_dup(serial); 87 in = ASN1_STRING_dup(serial);
88 if (in != NULL) { 88 if (in != NULL) {
89 M_ASN1_INTEGER_free(x->cert_info->serialNumber); 89 M_ASN1_INTEGER_free(x->cert_info->serialNumber);
90 x->cert_info->serialNumber = in; 90 x->cert_info->serialNumber = in;
@@ -118,7 +118,7 @@ X509_set_notBefore(X509 *x, const ASN1_TIME *tm)
118 return (0); 118 return (0);
119 in = x->cert_info->validity->notBefore; 119 in = x->cert_info->validity->notBefore;
120 if (in != tm) { 120 if (in != tm) {
121 in = M_ASN1_TIME_dup(tm); 121 in = ASN1_STRING_dup(tm);
122 if (in != NULL) { 122 if (in != NULL) {
123 M_ASN1_TIME_free(x->cert_info->validity->notBefore); 123 M_ASN1_TIME_free(x->cert_info->validity->notBefore);
124 x->cert_info->validity->notBefore = in; 124 x->cert_info->validity->notBefore = in;
@@ -136,7 +136,7 @@ X509_set_notAfter(X509 *x, const ASN1_TIME *tm)
136 return (0); 136 return (0);
137 in = x->cert_info->validity->notAfter; 137 in = x->cert_info->validity->notAfter;
138 if (in != tm) { 138 if (in != tm) {
139 in = M_ASN1_TIME_dup(tm); 139 in = ASN1_STRING_dup(tm);
140 if (in != NULL) { 140 if (in != NULL) {
141 M_ASN1_TIME_free(x->cert_info->validity->notAfter); 141 M_ASN1_TIME_free(x->cert_info->validity->notAfter);
142 x->cert_info->validity->notAfter = in; 142 x->cert_info->validity->notAfter = in;
diff --git a/src/lib/libcrypto/x509/x509_v3.c b/src/lib/libcrypto/x509/x509_v3.c
index 3d3a96f59b..a9f3fdb10e 100644
--- a/src/lib/libcrypto/x509/x509_v3.c
+++ b/src/lib/libcrypto/x509/x509_v3.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_v3.c,v 1.11 2014/09/28 10:53:57 miod Exp $ */ 1/* $OpenBSD: x509_v3.c,v 1.12 2015/07/29 14:58:34 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -267,7 +267,7 @@ X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data)
267 267
268 if (ex == NULL) 268 if (ex == NULL)
269 return (0); 269 return (0);
270 i = M_ASN1_OCTET_STRING_set(ex->value, data->data, data->length); 270 i = ASN1_STRING_set(ex->value, data->data, data->length);
271 if (!i) 271 if (!i)
272 return (0); 272 return (0);
273 return (1); 273 return (1);
diff --git a/src/lib/libcrypto/x509/x509cset.c b/src/lib/libcrypto/x509/x509cset.c
index a4442632f6..94c419301a 100644
--- a/src/lib/libcrypto/x509/x509cset.c
+++ b/src/lib/libcrypto/x509/x509cset.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509cset.c,v 1.8 2014/07/11 08:44:49 jsing Exp $ */ 1/* $OpenBSD: x509cset.c,v 1.9 2015/07/29 14:58:34 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2001. 3 * project 2001.
4 */ 4 */
@@ -92,7 +92,7 @@ X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm)
92 return (0); 92 return (0);
93 in = x->crl->lastUpdate; 93 in = x->crl->lastUpdate;
94 if (in != tm) { 94 if (in != tm) {
95 in = M_ASN1_TIME_dup(tm); 95 in = ASN1_STRING_dup(tm);
96 if (in != NULL) { 96 if (in != NULL) {
97 M_ASN1_TIME_free(x->crl->lastUpdate); 97 M_ASN1_TIME_free(x->crl->lastUpdate);
98 x->crl->lastUpdate = in; 98 x->crl->lastUpdate = in;
@@ -110,7 +110,7 @@ X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm)
110 return (0); 110 return (0);
111 in = x->crl->nextUpdate; 111 in = x->crl->nextUpdate;
112 if (in != tm) { 112 if (in != tm) {
113 in = M_ASN1_TIME_dup(tm); 113 in = ASN1_STRING_dup(tm);
114 if (in != NULL) { 114 if (in != NULL) {
115 M_ASN1_TIME_free(x->crl->nextUpdate); 115 M_ASN1_TIME_free(x->crl->nextUpdate);
116 x->crl->nextUpdate = in; 116 x->crl->nextUpdate = in;
@@ -145,7 +145,7 @@ X509_REVOKED_set_revocationDate(X509_REVOKED *x, ASN1_TIME *tm)
145 return (0); 145 return (0);
146 in = x->revocationDate; 146 in = x->revocationDate;
147 if (in != tm) { 147 if (in != tm) {
148 in = M_ASN1_TIME_dup(tm); 148 in = ASN1_STRING_dup(tm);
149 if (in != NULL) { 149 if (in != NULL) {
150 M_ASN1_TIME_free(x->revocationDate); 150 M_ASN1_TIME_free(x->revocationDate);
151 x->revocationDate = in; 151 x->revocationDate = in;
@@ -163,7 +163,7 @@ X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial)
163 return (0); 163 return (0);
164 in = x->serialNumber; 164 in = x->serialNumber;
165 if (in != serial) { 165 if (in != serial) {
166 in = M_ASN1_INTEGER_dup(serial); 166 in = ASN1_STRING_dup(serial);
167 if (in != NULL) { 167 if (in != NULL) {
168 M_ASN1_INTEGER_free(x->serialNumber); 168 M_ASN1_INTEGER_free(x->serialNumber);
169 x->serialNumber = in; 169 x->serialNumber = in;
diff --git a/src/lib/libcrypto/x509v3/v3_akey.c b/src/lib/libcrypto/x509v3/v3_akey.c
index d5b5f685af..2bf515cfdd 100644
--- a/src/lib/libcrypto/x509v3/v3_akey.c
+++ b/src/lib/libcrypto/x509v3/v3_akey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_akey.c,v 1.13 2014/10/05 18:26:22 miod Exp $ */ 1/* $OpenBSD: v3_akey.c,v 1.14 2015/07/29 14:58:34 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -169,7 +169,7 @@ v2i_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
169 169
170 if ((issuer && !ikeyid) || (issuer == 2)) { 170 if ((issuer && !ikeyid) || (issuer == 2)) {
171 isname = X509_NAME_dup(X509_get_issuer_name(cert)); 171 isname = X509_NAME_dup(X509_get_issuer_name(cert));
172 serial = M_ASN1_INTEGER_dup(X509_get_serialNumber(cert)); 172 serial = ASN1_STRING_dup(X509_get_serialNumber(cert));
173 if (!isname || !serial) { 173 if (!isname || !serial) {
174 X509V3err(X509V3_F_V2I_AUTHORITY_KEYID, 174 X509V3err(X509V3_F_V2I_AUTHORITY_KEYID,
175 X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS); 175 X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS);
diff --git a/src/lib/libcrypto/x509v3/v3_alt.c b/src/lib/libcrypto/x509v3/v3_alt.c
index 2592288bdb..5b0dae2af6 100644
--- a/src/lib/libcrypto/x509v3/v3_alt.c
+++ b/src/lib/libcrypto/x509v3/v3_alt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_alt.c,v 1.22 2014/10/28 05:46:56 miod Exp $ */ 1/* $OpenBSD: v3_alt.c,v 1.23 2015/07/29 14:58:34 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project. 3 * project.
4 */ 4 */
@@ -390,7 +390,7 @@ copy_email(X509V3_CTX *ctx, GENERAL_NAMES *gens, int move_p)
390 while ((i = X509_NAME_get_index_by_NID(nm, 390 while ((i = X509_NAME_get_index_by_NID(nm,
391 NID_pkcs9_emailAddress, i)) >= 0) { 391 NID_pkcs9_emailAddress, i)) >= 0) {
392 ne = X509_NAME_get_entry(nm, i); 392 ne = X509_NAME_get_entry(nm, i);
393 email = M_ASN1_IA5STRING_dup(X509_NAME_ENTRY_get_data(ne)); 393 email = ASN1_STRING_dup(X509_NAME_ENTRY_get_data(ne));
394 if (move_p) { 394 if (move_p) {
395 X509_NAME_delete_entry(nm, i); 395 X509_NAME_delete_entry(nm, i);
396 X509_NAME_ENTRY_free(ne); 396 X509_NAME_ENTRY_free(ne);
diff --git a/src/lib/libcrypto/x509v3/v3_prn.c b/src/lib/libcrypto/x509v3/v3_prn.c
index 037d129c87..e2d8dd8c87 100644
--- a/src/lib/libcrypto/x509v3/v3_prn.c
+++ b/src/lib/libcrypto/x509v3/v3_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_prn.c,v 1.17 2014/07/11 08:44:49 jsing Exp $ */ 1/* $OpenBSD: v3_prn.c,v 1.18 2015/07/29 14:58:34 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -178,7 +178,7 @@ X509V3_extensions_print(BIO *bp, char *title, STACK_OF(X509_EXTENSION) *exts,
178 return 0; 178 return 0;
179 if (!X509V3_EXT_print(bp, ex, flag, indent + 4)) { 179 if (!X509V3_EXT_print(bp, ex, flag, indent + 4)) {
180 BIO_printf(bp, "%*s", indent + 4, ""); 180 BIO_printf(bp, "%*s", indent + 4, "");
181 M_ASN1_OCTET_STRING_print(bp, ex->value); 181 ASN1_STRING_print(bp, ex->value);
182 } 182 }
183 if (BIO_write(bp, "\n",1) <= 0) 183 if (BIO_write(bp, "\n",1) <= 0)
184 return 0; 184 return 0;
diff --git a/src/lib/libcrypto/x509v3/v3_skey.c b/src/lib/libcrypto/x509v3/v3_skey.c
index ab2521f21a..1bcf8dacfb 100644
--- a/src/lib/libcrypto/x509v3/v3_skey.c
+++ b/src/lib/libcrypto/x509v3/v3_skey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_skey.c,v 1.10 2014/07/11 08:44:49 jsing Exp $ */ 1/* $OpenBSD: v3_skey.c,v 1.11 2015/07/29 14:58:34 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -138,7 +138,7 @@ s2i_skey_id(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str)
138 EVP_sha1(), NULL)) 138 EVP_sha1(), NULL))
139 goto err; 139 goto err;
140 140
141 if (!M_ASN1_OCTET_STRING_set(oct, pkey_dig, diglen)) { 141 if (!ASN1_STRING_set(oct, pkey_dig, diglen)) {
142 X509V3err(X509V3_F_S2I_SKEY_ID, ERR_R_MALLOC_FAILURE); 142 X509V3err(X509V3_F_S2I_SKEY_ID, ERR_R_MALLOC_FAILURE);
143 goto err; 143 goto err;
144 } 144 }
diff --git a/src/lib/libcrypto/x509v3/v3_sxnet.c b/src/lib/libcrypto/x509v3/v3_sxnet.c
index d87dd34339..546b790782 100644
--- a/src/lib/libcrypto/x509v3/v3_sxnet.c
+++ b/src/lib/libcrypto/x509v3/v3_sxnet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_sxnet.c,v 1.14 2015/07/25 16:00:14 jsing Exp $ */ 1/* $OpenBSD: v3_sxnet.c,v 1.15 2015/07/29 14:58:34 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -211,7 +211,7 @@ sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out, int indent)
211 tmp = i2s_ASN1_INTEGER(NULL, id->zone); 211 tmp = i2s_ASN1_INTEGER(NULL, id->zone);
212 BIO_printf(out, "\n%*sZone: %s, User: ", indent, "", tmp); 212 BIO_printf(out, "\n%*sZone: %s, User: ", indent, "", tmp);
213 free(tmp); 213 free(tmp);
214 M_ASN1_OCTET_STRING_print(out, id->user); 214 ASN1_STRING_print(out, id->user);
215 } 215 }
216 return 1; 216 return 1;
217} 217}
@@ -316,7 +316,7 @@ SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *zone, char *user, int userlen)
316 if (userlen == -1) 316 if (userlen == -1)
317 userlen = strlen(user); 317 userlen = strlen(user);
318 318
319 if (!M_ASN1_OCTET_STRING_set(id->user, user, userlen)) 319 if (!ASN1_STRING_set(id->user, user, userlen))
320 goto err; 320 goto err;
321 if (!sk_SXNETID_push(sx->ids, id)) 321 if (!sk_SXNETID_push(sx->ids, id))
322 goto err; 322 goto err;
@@ -372,7 +372,7 @@ SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone)
372 372
373 for (i = 0; i < sk_SXNETID_num(sx->ids); i++) { 373 for (i = 0; i < sk_SXNETID_num(sx->ids); i++) {
374 id = sk_SXNETID_value(sx->ids, i); 374 id = sk_SXNETID_value(sx->ids, i);
375 if (!M_ASN1_INTEGER_cmp(id->zone, zone)) 375 if (!ASN1_STRING_cmp(id->zone, zone))
376 return id->user; 376 return id->user;
377 } 377 }
378 return NULL; 378 return NULL;
diff --git a/src/lib/libssl/src/crypto/asn1/a_bitstr.c b/src/lib/libssl/src/crypto/asn1/a_bitstr.c
index 5575a5c939..c0259ad815 100644
--- a/src/lib/libssl/src/crypto/asn1/a_bitstr.c
+++ b/src/lib/libssl/src/crypto/asn1/a_bitstr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_bitstr.c,v 1.21 2015/07/19 18:29:31 miod Exp $ */ 1/* $OpenBSD: a_bitstr.c,v 1.22 2015/07/29 14:58:34 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -65,7 +65,7 @@
65int 65int
66ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len) 66ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len)
67{ 67{
68 return M_ASN1_BIT_STRING_set(x, d, len); 68 return ASN1_STRING_set(x, d, len);
69} 69}
70 70
71int 71int
diff --git a/src/lib/libssl/src/crypto/asn1/a_int.c b/src/lib/libssl/src/crypto/asn1/a_int.c
index 7d17aae2a2..6a378c0884 100644
--- a/src/lib/libssl/src/crypto/asn1/a_int.c
+++ b/src/lib/libssl/src/crypto/asn1/a_int.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_int.c,v 1.27 2015/07/19 18:29:31 miod Exp $ */ 1/* $OpenBSD: a_int.c,v 1.28 2015/07/29 14:58:34 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -66,7 +66,7 @@
66ASN1_INTEGER * 66ASN1_INTEGER *
67ASN1_INTEGER_dup(const ASN1_INTEGER *x) 67ASN1_INTEGER_dup(const ASN1_INTEGER *x)
68{ 68{
69 return M_ASN1_INTEGER_dup(x); 69 return ASN1_STRING_dup(x);
70} 70}
71 71
72int 72int
diff --git a/src/lib/libssl/src/crypto/asn1/a_octet.c b/src/lib/libssl/src/crypto/asn1/a_octet.c
index 8c57592174..d998675d3f 100644
--- a/src/lib/libssl/src/crypto/asn1/a_octet.c
+++ b/src/lib/libssl/src/crypto/asn1/a_octet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_octet.c,v 1.9 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: a_octet.c,v 1.10 2015/07/29 14:58:34 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -63,17 +63,17 @@
63ASN1_OCTET_STRING * 63ASN1_OCTET_STRING *
64ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *x) 64ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *x)
65{ 65{
66 return M_ASN1_OCTET_STRING_dup(x); 66 return ASN1_STRING_dup(x);
67} 67}
68 68
69int 69int
70ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a, const ASN1_OCTET_STRING *b) 70ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a, const ASN1_OCTET_STRING *b)
71{ 71{
72 return M_ASN1_OCTET_STRING_cmp(a, b); 72 return ASN1_STRING_cmp(a, b);
73} 73}
74 74
75int 75int
76ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *x, const unsigned char *d, int len) 76ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *x, const unsigned char *d, int len)
77{ 77{
78 return M_ASN1_OCTET_STRING_set(x, d, len); 78 return ASN1_STRING_set(x, d, len);
79} 79}
diff --git a/src/lib/libssl/src/crypto/asn1/evp_asn1.c b/src/lib/libssl/src/crypto/asn1/evp_asn1.c
index 5e21f3c8ae..5ee4751763 100644
--- a/src/lib/libssl/src/crypto/asn1/evp_asn1.c
+++ b/src/lib/libssl/src/crypto/asn1/evp_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_asn1.c,v 1.13 2014/07/12 16:03:36 miod Exp $ */ 1/* $OpenBSD: evp_asn1.c,v 1.14 2015/07/29 14:58:34 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -70,7 +70,7 @@ ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len)
70 70
71 if ((os = M_ASN1_OCTET_STRING_new()) == NULL) 71 if ((os = M_ASN1_OCTET_STRING_new()) == NULL)
72 return (0); 72 return (0);
73 if (!M_ASN1_OCTET_STRING_set(os, data, len)) { 73 if (!ASN1_STRING_set(os, data, len)) {
74 M_ASN1_OCTET_STRING_free(os); 74 M_ASN1_OCTET_STRING_free(os);
75 return (0); 75 return (0);
76 } 76 }
diff --git a/src/lib/libssl/src/crypto/asn1/t_req.c b/src/lib/libssl/src/crypto/asn1/t_req.c
index 51f711acf7..8db456708a 100644
--- a/src/lib/libssl/src/crypto/asn1/t_req.c
+++ b/src/lib/libssl/src/crypto/asn1/t_req.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t_req.c,v 1.17 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: t_req.c,v 1.18 2015/07/29 14:58:34 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -239,7 +239,7 @@ get_next:
239 goto err; 239 goto err;
240 if (!X509V3_EXT_print(bp, ex, cflag, 16)) { 240 if (!X509V3_EXT_print(bp, ex, cflag, 16)) {
241 BIO_printf(bp, "%16s", ""); 241 BIO_printf(bp, "%16s", "");
242 M_ASN1_OCTET_STRING_print(bp, ex->value); 242 ASN1_STRING_print(bp, ex->value);
243 } 243 }
244 if (BIO_write(bp, "\n", 1) <= 0) 244 if (BIO_write(bp, "\n", 1) <= 0)
245 goto err; 245 goto err;
diff --git a/src/lib/libssl/src/crypto/ec/ec_asn1.c b/src/lib/libssl/src/crypto/ec/ec_asn1.c
index 0ee949134e..2e7e1746fa 100644
--- a/src/lib/libssl/src/crypto/ec/ec_asn1.c
+++ b/src/lib/libssl/src/crypto/ec/ec_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_asn1.c,v 1.15 2015/07/25 14:36:39 jsing Exp $ */ 1/* $OpenBSD: ec_asn1.c,v 1.16 2015/07/29 14:58:34 jsing Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project. 3 * Written by Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -858,8 +858,8 @@ ec_asn1_group2curve(const EC_GROUP * group, X9_62_CURVE * curve)
858 } 858 }
859 859
860 /* set a and b */ 860 /* set a and b */
861 if (!M_ASN1_OCTET_STRING_set(curve->a, a_buf, len_1) || 861 if (!ASN1_STRING_set(curve->a, a_buf, len_1) ||
862 !M_ASN1_OCTET_STRING_set(curve->b, b_buf, len_2)) { 862 !ASN1_STRING_set(curve->b, b_buf, len_2)) {
863 ECerr(EC_F_EC_ASN1_GROUP2CURVE, ERR_R_ASN1_LIB); 863 ECerr(EC_F_EC_ASN1_GROUP2CURVE, ERR_R_ASN1_LIB);
864 goto err; 864 goto err;
865 } 865 }
@@ -1447,7 +1447,7 @@ i2d_ECPrivateKey(EC_KEY * a, unsigned char **out)
1447 ECerr(EC_F_I2D_ECPRIVATEKEY, ERR_R_BN_LIB); 1447 ECerr(EC_F_I2D_ECPRIVATEKEY, ERR_R_BN_LIB);
1448 goto err; 1448 goto err;
1449 } 1449 }
1450 if (!M_ASN1_OCTET_STRING_set(priv_key->privateKey, buffer, buf_len)) { 1450 if (!ASN1_STRING_set(priv_key->privateKey, buffer, buf_len)) {
1451 ECerr(EC_F_I2D_ECPRIVATEKEY, ERR_R_ASN1_LIB); 1451 ECerr(EC_F_I2D_ECPRIVATEKEY, ERR_R_ASN1_LIB);
1452 goto err; 1452 goto err;
1453 } 1453 }
@@ -1484,7 +1484,7 @@ i2d_ECPrivateKey(EC_KEY * a, unsigned char **out)
1484 } 1484 }
1485 priv_key->publicKey->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07); 1485 priv_key->publicKey->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07);
1486 priv_key->publicKey->flags |= ASN1_STRING_FLAG_BITS_LEFT; 1486 priv_key->publicKey->flags |= ASN1_STRING_FLAG_BITS_LEFT;
1487 if (!M_ASN1_BIT_STRING_set(priv_key->publicKey, buffer, 1487 if (!ASN1_STRING_set(priv_key->publicKey, buffer,
1488 buf_len)) { 1488 buf_len)) {
1489 ECerr(EC_F_I2D_ECPRIVATEKEY, ERR_R_ASN1_LIB); 1489 ECerr(EC_F_I2D_ECPRIVATEKEY, ERR_R_ASN1_LIB);
1490 goto err; 1490 goto err;
diff --git a/src/lib/libssl/src/crypto/pkcs12/p12_mutl.c b/src/lib/libssl/src/crypto/pkcs12/p12_mutl.c
index ac58f50ca7..00acf1f210 100644
--- a/src/lib/libssl/src/crypto/pkcs12/p12_mutl.c
+++ b/src/lib/libssl/src/crypto/pkcs12/p12_mutl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_mutl.c,v 1.19 2014/10/22 18:37:22 miod Exp $ */ 1/* $OpenBSD: p12_mutl.c,v 1.20 2015/07/29 14:58:34 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -160,7 +160,7 @@ PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen, unsigned char *salt,
160 PKCS12_R_MAC_GENERATION_ERROR); 160 PKCS12_R_MAC_GENERATION_ERROR);
161 return 0; 161 return 0;
162 } 162 }
163 if (!(M_ASN1_OCTET_STRING_set(p12->mac->dinfo->digest, mac, maclen))) { 163 if (!(ASN1_STRING_set(p12->mac->dinfo->digest, mac, maclen))) {
164 PKCS12err(PKCS12_F_PKCS12_SET_MAC, 164 PKCS12err(PKCS12_F_PKCS12_SET_MAC,
165 PKCS12_R_MAC_STRING_SET_ERROR); 165 PKCS12_R_MAC_STRING_SET_ERROR);
166 return 0; 166 return 0;
diff --git a/src/lib/libssl/src/crypto/pkcs7/pk7_doit.c b/src/lib/libssl/src/crypto/pkcs7/pk7_doit.c
index 2c69edf499..24bcebef61 100644
--- a/src/lib/libssl/src/crypto/pkcs7/pk7_doit.c
+++ b/src/lib/libssl/src/crypto/pkcs7/pk7_doit.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pk7_doit.c,v 1.35 2015/07/19 18:25:59 miod Exp $ */ 1/* $OpenBSD: pk7_doit.c,v 1.36 2015/07/29 14:58:34 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -417,7 +417,7 @@ pkcs7_cmp_ri(PKCS7_RECIP_INFO *ri, X509 *pcert)
417 pcert->cert_info->issuer); 417 pcert->cert_info->issuer);
418 if (ret) 418 if (ret)
419 return ret; 419 return ret;
420 return M_ASN1_INTEGER_cmp(pcert->cert_info->serialNumber, 420 return ASN1_STRING_cmp(pcert->cert_info->serialNumber,
421 ri->issuer_and_serial->serial); 421 ri->issuer_and_serial->serial);
422} 422}
423 423
@@ -856,7 +856,7 @@ PKCS7_dataFinal(PKCS7 *p7, BIO *bio)
856 goto err; 856 goto err;
857 if (!EVP_DigestFinal_ex(mdc, md_data, &md_len)) 857 if (!EVP_DigestFinal_ex(mdc, md_data, &md_len))
858 goto err; 858 goto err;
859 if (M_ASN1_OCTET_STRING_set(p7->d.digest->digest, md_data, 859 if (ASN1_STRING_set(p7->d.digest->digest, md_data,
860 md_len) == 0) 860 md_len) == 0)
861 goto err; 861 goto err;
862 } 862 }
diff --git a/src/lib/libssl/src/crypto/pkcs7/pk7_lib.c b/src/lib/libssl/src/crypto/pkcs7/pk7_lib.c
index 3eec92e29b..9f7e4f2dd3 100644
--- a/src/lib/libssl/src/crypto/pkcs7/pk7_lib.c
+++ b/src/lib/libssl/src/crypto/pkcs7/pk7_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pk7_lib.c,v 1.15 2015/03/19 14:00:22 tedu Exp $ */ 1/* $OpenBSD: pk7_lib.c,v 1.16 2015/07/29 14:58:34 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -380,7 +380,7 @@ PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey,
380 * things the ugly way. */ 380 * things the ugly way. */
381 M_ASN1_INTEGER_free(p7i->issuer_and_serial->serial); 381 M_ASN1_INTEGER_free(p7i->issuer_and_serial->serial);
382 if (!(p7i->issuer_and_serial->serial = 382 if (!(p7i->issuer_and_serial->serial =
383 M_ASN1_INTEGER_dup(X509_get_serialNumber(x509)))) 383 ASN1_STRING_dup(X509_get_serialNumber(x509))))
384 goto err; 384 goto err;
385 385
386 /* lets keep the pkey around for a while */ 386 /* lets keep the pkey around for a while */
@@ -545,7 +545,7 @@ PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509)
545 545
546 M_ASN1_INTEGER_free(p7i->issuer_and_serial->serial); 546 M_ASN1_INTEGER_free(p7i->issuer_and_serial->serial);
547 if (!(p7i->issuer_and_serial->serial = 547 if (!(p7i->issuer_and_serial->serial =
548 M_ASN1_INTEGER_dup(X509_get_serialNumber(x509)))) 548 ASN1_STRING_dup(X509_get_serialNumber(x509))))
549 return 0; 549 return 0;
550 550
551 pkey = X509_get_pubkey(x509); 551 pkey = X509_get_pubkey(x509);
diff --git a/src/lib/libssl/src/crypto/ts/ts_lib.c b/src/lib/libssl/src/crypto/ts/ts_lib.c
index f08bb8701d..ac5f65df94 100644
--- a/src/lib/libssl/src/crypto/ts/ts_lib.c
+++ b/src/lib/libssl/src/crypto/ts/ts_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_lib.c,v 1.8 2014/07/11 08:44:49 jsing Exp $ */ 1/* $OpenBSD: ts_lib.c,v 1.9 2015/07/29 14:58:34 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
4 */ 4 */
@@ -117,7 +117,7 @@ TS_ext_print_bio(BIO *bio, const STACK_OF(X509_EXTENSION) *extensions)
117 BIO_printf(bio, ": %s\n", critical ? "critical" : ""); 117 BIO_printf(bio, ": %s\n", critical ? "critical" : "");
118 if (!X509V3_EXT_print(bio, ex, 0, 4)) { 118 if (!X509V3_EXT_print(bio, ex, 0, 4)) {
119 BIO_printf(bio, "%4s", ""); 119 BIO_printf(bio, "%4s", "");
120 M_ASN1_OCTET_STRING_print(bio, ex->value); 120 ASN1_STRING_print(bio, ex->value);
121 } 121 }
122 BIO_write(bio, "\n", 1); 122 BIO_write(bio, "\n", 1);
123 } 123 }
diff --git a/src/lib/libssl/src/crypto/ts/ts_rsp_utils.c b/src/lib/libssl/src/crypto/ts/ts_rsp_utils.c
index 0d05814297..39eb2a2963 100644
--- a/src/lib/libssl/src/crypto/ts/ts_rsp_utils.c
+++ b/src/lib/libssl/src/crypto/ts/ts_rsp_utils.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_rsp_utils.c,v 1.4 2014/07/11 08:44:49 jsing Exp $ */ 1/* $OpenBSD: ts_rsp_utils.c,v 1.5 2015/07/29 14:58:34 jsing Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
4 */ 4 */
@@ -200,7 +200,7 @@ TS_TST_INFO_set_time(TS_TST_INFO *a, const ASN1_GENERALIZEDTIME *gtime)
200 200
201 if (a->time == gtime) 201 if (a->time == gtime)
202 return 1; 202 return 1;
203 new_time = M_ASN1_GENERALIZEDTIME_dup(gtime); 203 new_time = ASN1_STRING_dup(gtime);
204 if (new_time == NULL) { 204 if (new_time == NULL) {
205 TSerr(TS_F_TS_TST_INFO_SET_TIME, ERR_R_MALLOC_FAILURE); 205 TSerr(TS_F_TS_TST_INFO_SET_TIME, ERR_R_MALLOC_FAILURE);
206 return 0; 206 return 0;
diff --git a/src/lib/libssl/src/crypto/x509/x509_cmp.c b/src/lib/libssl/src/crypto/x509/x509_cmp.c
index 030e29bde7..407e1e07ad 100644
--- a/src/lib/libssl/src/crypto/x509/x509_cmp.c
+++ b/src/lib/libssl/src/crypto/x509/x509_cmp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_cmp.c,v 1.25 2014/09/26 19:31:09 miod Exp $ */ 1/* $OpenBSD: x509_cmp.c,v 1.26 2015/07/29 14:58:34 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -76,7 +76,7 @@ X509_issuer_and_serial_cmp(const X509 *a, const X509 *b)
76 76
77 ai = a->cert_info; 77 ai = a->cert_info;
78 bi = b->cert_info; 78 bi = b->cert_info;
79 i = M_ASN1_INTEGER_cmp(ai->serialNumber, bi->serialNumber); 79 i = ASN1_STRING_cmp(ai->serialNumber, bi->serialNumber);
80 if (i) 80 if (i)
81 return (i); 81 return (i);
82 return (X509_NAME_cmp(ai->issuer, bi->issuer)); 82 return (X509_NAME_cmp(ai->issuer, bi->issuer));
diff --git a/src/lib/libssl/src/crypto/x509/x509_set.c b/src/lib/libssl/src/crypto/x509/x509_set.c
index 3be557cbc0..c6160b90b0 100644
--- a/src/lib/libssl/src/crypto/x509/x509_set.c
+++ b/src/lib/libssl/src/crypto/x509/x509_set.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_set.c,v 1.9 2014/07/11 08:44:49 jsing Exp $ */ 1/* $OpenBSD: x509_set.c,v 1.10 2015/07/29 14:58:34 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -84,7 +84,7 @@ X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial)
84 return (0); 84 return (0);
85 in = x->cert_info->serialNumber; 85 in = x->cert_info->serialNumber;
86 if (in != serial) { 86 if (in != serial) {
87 in = M_ASN1_INTEGER_dup(serial); 87 in = ASN1_STRING_dup(serial);
88 if (in != NULL) { 88 if (in != NULL) {
89 M_ASN1_INTEGER_free(x->cert_info->serialNumber); 89 M_ASN1_INTEGER_free(x->cert_info->serialNumber);
90 x->cert_info->serialNumber = in; 90 x->cert_info->serialNumber = in;
@@ -118,7 +118,7 @@ X509_set_notBefore(X509 *x, const ASN1_TIME *tm)
118 return (0); 118 return (0);
119 in = x->cert_info->validity->notBefore; 119 in = x->cert_info->validity->notBefore;
120 if (in != tm) { 120 if (in != tm) {
121 in = M_ASN1_TIME_dup(tm); 121 in = ASN1_STRING_dup(tm);
122 if (in != NULL) { 122 if (in != NULL) {
123 M_ASN1_TIME_free(x->cert_info->validity->notBefore); 123 M_ASN1_TIME_free(x->cert_info->validity->notBefore);
124 x->cert_info->validity->notBefore = in; 124 x->cert_info->validity->notBefore = in;
@@ -136,7 +136,7 @@ X509_set_notAfter(X509 *x, const ASN1_TIME *tm)
136 return (0); 136 return (0);
137 in = x->cert_info->validity->notAfter; 137 in = x->cert_info->validity->notAfter;
138 if (in != tm) { 138 if (in != tm) {
139 in = M_ASN1_TIME_dup(tm); 139 in = ASN1_STRING_dup(tm);
140 if (in != NULL) { 140 if (in != NULL) {
141 M_ASN1_TIME_free(x->cert_info->validity->notAfter); 141 M_ASN1_TIME_free(x->cert_info->validity->notAfter);
142 x->cert_info->validity->notAfter = in; 142 x->cert_info->validity->notAfter = in;
diff --git a/src/lib/libssl/src/crypto/x509/x509_v3.c b/src/lib/libssl/src/crypto/x509/x509_v3.c
index 3d3a96f59b..a9f3fdb10e 100644
--- a/src/lib/libssl/src/crypto/x509/x509_v3.c
+++ b/src/lib/libssl/src/crypto/x509/x509_v3.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_v3.c,v 1.11 2014/09/28 10:53:57 miod Exp $ */ 1/* $OpenBSD: x509_v3.c,v 1.12 2015/07/29 14:58:34 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -267,7 +267,7 @@ X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data)
267 267
268 if (ex == NULL) 268 if (ex == NULL)
269 return (0); 269 return (0);
270 i = M_ASN1_OCTET_STRING_set(ex->value, data->data, data->length); 270 i = ASN1_STRING_set(ex->value, data->data, data->length);
271 if (!i) 271 if (!i)
272 return (0); 272 return (0);
273 return (1); 273 return (1);
diff --git a/src/lib/libssl/src/crypto/x509/x509cset.c b/src/lib/libssl/src/crypto/x509/x509cset.c
index a4442632f6..94c419301a 100644
--- a/src/lib/libssl/src/crypto/x509/x509cset.c
+++ b/src/lib/libssl/src/crypto/x509/x509cset.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509cset.c,v 1.8 2014/07/11 08:44:49 jsing Exp $ */ 1/* $OpenBSD: x509cset.c,v 1.9 2015/07/29 14:58:34 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2001. 3 * project 2001.
4 */ 4 */
@@ -92,7 +92,7 @@ X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm)
92 return (0); 92 return (0);
93 in = x->crl->lastUpdate; 93 in = x->crl->lastUpdate;
94 if (in != tm) { 94 if (in != tm) {
95 in = M_ASN1_TIME_dup(tm); 95 in = ASN1_STRING_dup(tm);
96 if (in != NULL) { 96 if (in != NULL) {
97 M_ASN1_TIME_free(x->crl->lastUpdate); 97 M_ASN1_TIME_free(x->crl->lastUpdate);
98 x->crl->lastUpdate = in; 98 x->crl->lastUpdate = in;
@@ -110,7 +110,7 @@ X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm)
110 return (0); 110 return (0);
111 in = x->crl->nextUpdate; 111 in = x->crl->nextUpdate;
112 if (in != tm) { 112 if (in != tm) {
113 in = M_ASN1_TIME_dup(tm); 113 in = ASN1_STRING_dup(tm);
114 if (in != NULL) { 114 if (in != NULL) {
115 M_ASN1_TIME_free(x->crl->nextUpdate); 115 M_ASN1_TIME_free(x->crl->nextUpdate);
116 x->crl->nextUpdate = in; 116 x->crl->nextUpdate = in;
@@ -145,7 +145,7 @@ X509_REVOKED_set_revocationDate(X509_REVOKED *x, ASN1_TIME *tm)
145 return (0); 145 return (0);
146 in = x->revocationDate; 146 in = x->revocationDate;
147 if (in != tm) { 147 if (in != tm) {
148 in = M_ASN1_TIME_dup(tm); 148 in = ASN1_STRING_dup(tm);
149 if (in != NULL) { 149 if (in != NULL) {
150 M_ASN1_TIME_free(x->revocationDate); 150 M_ASN1_TIME_free(x->revocationDate);
151 x->revocationDate = in; 151 x->revocationDate = in;
@@ -163,7 +163,7 @@ X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial)
163 return (0); 163 return (0);
164 in = x->serialNumber; 164 in = x->serialNumber;
165 if (in != serial) { 165 if (in != serial) {
166 in = M_ASN1_INTEGER_dup(serial); 166 in = ASN1_STRING_dup(serial);
167 if (in != NULL) { 167 if (in != NULL) {
168 M_ASN1_INTEGER_free(x->serialNumber); 168 M_ASN1_INTEGER_free(x->serialNumber);
169 x->serialNumber = in; 169 x->serialNumber = in;
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_akey.c b/src/lib/libssl/src/crypto/x509v3/v3_akey.c
index d5b5f685af..2bf515cfdd 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_akey.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_akey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_akey.c,v 1.13 2014/10/05 18:26:22 miod Exp $ */ 1/* $OpenBSD: v3_akey.c,v 1.14 2015/07/29 14:58:34 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -169,7 +169,7 @@ v2i_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
169 169
170 if ((issuer && !ikeyid) || (issuer == 2)) { 170 if ((issuer && !ikeyid) || (issuer == 2)) {
171 isname = X509_NAME_dup(X509_get_issuer_name(cert)); 171 isname = X509_NAME_dup(X509_get_issuer_name(cert));
172 serial = M_ASN1_INTEGER_dup(X509_get_serialNumber(cert)); 172 serial = ASN1_STRING_dup(X509_get_serialNumber(cert));
173 if (!isname || !serial) { 173 if (!isname || !serial) {
174 X509V3err(X509V3_F_V2I_AUTHORITY_KEYID, 174 X509V3err(X509V3_F_V2I_AUTHORITY_KEYID,
175 X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS); 175 X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS);
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_alt.c b/src/lib/libssl/src/crypto/x509v3/v3_alt.c
index 2592288bdb..5b0dae2af6 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_alt.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_alt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_alt.c,v 1.22 2014/10/28 05:46:56 miod Exp $ */ 1/* $OpenBSD: v3_alt.c,v 1.23 2015/07/29 14:58:34 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project. 3 * project.
4 */ 4 */
@@ -390,7 +390,7 @@ copy_email(X509V3_CTX *ctx, GENERAL_NAMES *gens, int move_p)
390 while ((i = X509_NAME_get_index_by_NID(nm, 390 while ((i = X509_NAME_get_index_by_NID(nm,
391 NID_pkcs9_emailAddress, i)) >= 0) { 391 NID_pkcs9_emailAddress, i)) >= 0) {
392 ne = X509_NAME_get_entry(nm, i); 392 ne = X509_NAME_get_entry(nm, i);
393 email = M_ASN1_IA5STRING_dup(X509_NAME_ENTRY_get_data(ne)); 393 email = ASN1_STRING_dup(X509_NAME_ENTRY_get_data(ne));
394 if (move_p) { 394 if (move_p) {
395 X509_NAME_delete_entry(nm, i); 395 X509_NAME_delete_entry(nm, i);
396 X509_NAME_ENTRY_free(ne); 396 X509_NAME_ENTRY_free(ne);
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_prn.c b/src/lib/libssl/src/crypto/x509v3/v3_prn.c
index 037d129c87..e2d8dd8c87 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_prn.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_prn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_prn.c,v 1.17 2014/07/11 08:44:49 jsing Exp $ */ 1/* $OpenBSD: v3_prn.c,v 1.18 2015/07/29 14:58:34 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -178,7 +178,7 @@ X509V3_extensions_print(BIO *bp, char *title, STACK_OF(X509_EXTENSION) *exts,
178 return 0; 178 return 0;
179 if (!X509V3_EXT_print(bp, ex, flag, indent + 4)) { 179 if (!X509V3_EXT_print(bp, ex, flag, indent + 4)) {
180 BIO_printf(bp, "%*s", indent + 4, ""); 180 BIO_printf(bp, "%*s", indent + 4, "");
181 M_ASN1_OCTET_STRING_print(bp, ex->value); 181 ASN1_STRING_print(bp, ex->value);
182 } 182 }
183 if (BIO_write(bp, "\n",1) <= 0) 183 if (BIO_write(bp, "\n",1) <= 0)
184 return 0; 184 return 0;
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_skey.c b/src/lib/libssl/src/crypto/x509v3/v3_skey.c
index ab2521f21a..1bcf8dacfb 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_skey.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_skey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_skey.c,v 1.10 2014/07/11 08:44:49 jsing Exp $ */ 1/* $OpenBSD: v3_skey.c,v 1.11 2015/07/29 14:58:34 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -138,7 +138,7 @@ s2i_skey_id(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str)
138 EVP_sha1(), NULL)) 138 EVP_sha1(), NULL))
139 goto err; 139 goto err;
140 140
141 if (!M_ASN1_OCTET_STRING_set(oct, pkey_dig, diglen)) { 141 if (!ASN1_STRING_set(oct, pkey_dig, diglen)) {
142 X509V3err(X509V3_F_S2I_SKEY_ID, ERR_R_MALLOC_FAILURE); 142 X509V3err(X509V3_F_S2I_SKEY_ID, ERR_R_MALLOC_FAILURE);
143 goto err; 143 goto err;
144 } 144 }
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_sxnet.c b/src/lib/libssl/src/crypto/x509v3/v3_sxnet.c
index d87dd34339..546b790782 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_sxnet.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_sxnet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_sxnet.c,v 1.14 2015/07/25 16:00:14 jsing Exp $ */ 1/* $OpenBSD: v3_sxnet.c,v 1.15 2015/07/29 14:58:34 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -211,7 +211,7 @@ sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out, int indent)
211 tmp = i2s_ASN1_INTEGER(NULL, id->zone); 211 tmp = i2s_ASN1_INTEGER(NULL, id->zone);
212 BIO_printf(out, "\n%*sZone: %s, User: ", indent, "", tmp); 212 BIO_printf(out, "\n%*sZone: %s, User: ", indent, "", tmp);
213 free(tmp); 213 free(tmp);
214 M_ASN1_OCTET_STRING_print(out, id->user); 214 ASN1_STRING_print(out, id->user);
215 } 215 }
216 return 1; 216 return 1;
217} 217}
@@ -316,7 +316,7 @@ SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *zone, char *user, int userlen)
316 if (userlen == -1) 316 if (userlen == -1)
317 userlen = strlen(user); 317 userlen = strlen(user);
318 318
319 if (!M_ASN1_OCTET_STRING_set(id->user, user, userlen)) 319 if (!ASN1_STRING_set(id->user, user, userlen))
320 goto err; 320 goto err;
321 if (!sk_SXNETID_push(sx->ids, id)) 321 if (!sk_SXNETID_push(sx->ids, id))
322 goto err; 322 goto err;
@@ -372,7 +372,7 @@ SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone)
372 372
373 for (i = 0; i < sk_SXNETID_num(sx->ids); i++) { 373 for (i = 0; i < sk_SXNETID_num(sx->ids); i++) {
374 id = sk_SXNETID_value(sx->ids, i); 374 id = sk_SXNETID_value(sx->ids, i);
375 if (!M_ASN1_INTEGER_cmp(id->zone, zone)) 375 if (!ASN1_STRING_cmp(id->zone, zone))
376 return id->user; 376 return id->user;
377 } 377 }
378 return NULL; 378 return NULL;