diff options
author | jsing <> | 2014-04-26 11:08:59 +0000 |
---|---|---|
committer | jsing <> | 2014-04-26 11:08:59 +0000 |
commit | 9252e528b8dc5bc122ec8aeb936555f5879863d8 (patch) | |
tree | f5d99a88334876da15f81785165ddd32442dbea6 /src/lib | |
parent | ecbe88cd439c286c4dd9eb40f64c39c2039ab7ad (diff) | |
download | openbsd-9252e528b8dc5bc122ec8aeb936555f5879863d8.tar.gz openbsd-9252e528b8dc5bc122ec8aeb936555f5879863d8.tar.bz2 openbsd-9252e528b8dc5bc122ec8aeb936555f5879863d8.zip |
This is not FreeBSD.
ok miod@
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/bio/bss_dgram.c | 18 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/bio/bss_dgram.c | 18 |
2 files changed, 0 insertions, 36 deletions
diff --git a/src/lib/libcrypto/bio/bss_dgram.c b/src/lib/libcrypto/bio/bss_dgram.c index ab269aeba3..8c08eff352 100644 --- a/src/lib/libcrypto/bio/bss_dgram.c +++ b/src/lib/libcrypto/bio/bss_dgram.c | |||
@@ -80,16 +80,6 @@ | |||
80 | #define IP_MTU 14 /* linux is lame */ | 80 | #define IP_MTU 14 /* linux is lame */ |
81 | #endif | 81 | #endif |
82 | 82 | ||
83 | #if defined(__FreeBSD__) && defined(IN6_IS_ADDR_V4MAPPED) | ||
84 | /* Standard definition causes type-punning problems. */ | ||
85 | #undef IN6_IS_ADDR_V4MAPPED | ||
86 | #define s6_addr32 __u6_addr.__u6_addr32 | ||
87 | #define IN6_IS_ADDR_V4MAPPED(a) \ | ||
88 | (((a)->s6_addr32[0] == 0) && \ | ||
89 | ((a)->s6_addr32[1] == 0) && \ | ||
90 | ((a)->s6_addr32[2] == htonl(0x0000ffff))) | ||
91 | #endif | ||
92 | |||
93 | static int dgram_write(BIO *h, const char *buf, int num); | 83 | static int dgram_write(BIO *h, const char *buf, int num); |
94 | static int dgram_read(BIO *h, char *buf, int size); | 84 | static int dgram_read(BIO *h, char *buf, int size); |
95 | static int dgram_puts(BIO *h, const char *str); | 85 | static int dgram_puts(BIO *h, const char *str); |
@@ -1152,9 +1142,6 @@ dgram_sctp_write(BIO *b, const char *in, int inl) | |||
1152 | memset(sndrcvinfo, 0, sizeof(struct sctp_sndrcvinfo)); | 1142 | memset(sndrcvinfo, 0, sizeof(struct sctp_sndrcvinfo)); |
1153 | sndrcvinfo->sinfo_stream = sinfo->snd_sid; | 1143 | sndrcvinfo->sinfo_stream = sinfo->snd_sid; |
1154 | sndrcvinfo->sinfo_flags = sinfo->snd_flags; | 1144 | sndrcvinfo->sinfo_flags = sinfo->snd_flags; |
1155 | #ifdef __FreeBSD__ | ||
1156 | sndrcvinfo->sinfo_flags |= pinfo->pr_policy; | ||
1157 | #endif | ||
1158 | sndrcvinfo->sinfo_ppid = sinfo->snd_ppid; | 1145 | sndrcvinfo->sinfo_ppid = sinfo->snd_ppid; |
1159 | sndrcvinfo->sinfo_context = sinfo->snd_context; | 1146 | sndrcvinfo->sinfo_context = sinfo->snd_context; |
1160 | sndrcvinfo->sinfo_timetolive = pinfo->pr_value; | 1147 | sndrcvinfo->sinfo_timetolive = pinfo->pr_value; |
@@ -1237,12 +1224,7 @@ dgram_sctp_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
1237 | sockopt_len = sizeof(struct sctp_authkey) + 64 * sizeof(uint8_t); | 1224 | sockopt_len = sizeof(struct sctp_authkey) + 64 * sizeof(uint8_t); |
1238 | authkey = calloc(1, sockopt_len); | 1225 | authkey = calloc(1, sockopt_len); |
1239 | authkey->sca_keynumber = authkeyid.scact_keynumber + 1; | 1226 | authkey->sca_keynumber = authkeyid.scact_keynumber + 1; |
1240 | #ifndef __FreeBSD__ | ||
1241 | /* This field is missing in FreeBSD 8.2 and earlier, | ||
1242 | * and FreeBSD 8.3 and higher work without it. | ||
1243 | */ | ||
1244 | authkey->sca_keylength = 64; | 1227 | authkey->sca_keylength = 64; |
1245 | #endif | ||
1246 | memcpy(&authkey->sca_key[0], ptr, 64 * sizeof(uint8_t)); | 1228 | memcpy(&authkey->sca_key[0], ptr, 64 * sizeof(uint8_t)); |
1247 | 1229 | ||
1248 | ret = setsockopt(b->num, IPPROTO_SCTP, SCTP_AUTH_KEY, authkey, sockopt_len); | 1230 | ret = setsockopt(b->num, IPPROTO_SCTP, SCTP_AUTH_KEY, authkey, sockopt_len); |
diff --git a/src/lib/libssl/src/crypto/bio/bss_dgram.c b/src/lib/libssl/src/crypto/bio/bss_dgram.c index ab269aeba3..8c08eff352 100644 --- a/src/lib/libssl/src/crypto/bio/bss_dgram.c +++ b/src/lib/libssl/src/crypto/bio/bss_dgram.c | |||
@@ -80,16 +80,6 @@ | |||
80 | #define IP_MTU 14 /* linux is lame */ | 80 | #define IP_MTU 14 /* linux is lame */ |
81 | #endif | 81 | #endif |
82 | 82 | ||
83 | #if defined(__FreeBSD__) && defined(IN6_IS_ADDR_V4MAPPED) | ||
84 | /* Standard definition causes type-punning problems. */ | ||
85 | #undef IN6_IS_ADDR_V4MAPPED | ||
86 | #define s6_addr32 __u6_addr.__u6_addr32 | ||
87 | #define IN6_IS_ADDR_V4MAPPED(a) \ | ||
88 | (((a)->s6_addr32[0] == 0) && \ | ||
89 | ((a)->s6_addr32[1] == 0) && \ | ||
90 | ((a)->s6_addr32[2] == htonl(0x0000ffff))) | ||
91 | #endif | ||
92 | |||
93 | static int dgram_write(BIO *h, const char *buf, int num); | 83 | static int dgram_write(BIO *h, const char *buf, int num); |
94 | static int dgram_read(BIO *h, char *buf, int size); | 84 | static int dgram_read(BIO *h, char *buf, int size); |
95 | static int dgram_puts(BIO *h, const char *str); | 85 | static int dgram_puts(BIO *h, const char *str); |
@@ -1152,9 +1142,6 @@ dgram_sctp_write(BIO *b, const char *in, int inl) | |||
1152 | memset(sndrcvinfo, 0, sizeof(struct sctp_sndrcvinfo)); | 1142 | memset(sndrcvinfo, 0, sizeof(struct sctp_sndrcvinfo)); |
1153 | sndrcvinfo->sinfo_stream = sinfo->snd_sid; | 1143 | sndrcvinfo->sinfo_stream = sinfo->snd_sid; |
1154 | sndrcvinfo->sinfo_flags = sinfo->snd_flags; | 1144 | sndrcvinfo->sinfo_flags = sinfo->snd_flags; |
1155 | #ifdef __FreeBSD__ | ||
1156 | sndrcvinfo->sinfo_flags |= pinfo->pr_policy; | ||
1157 | #endif | ||
1158 | sndrcvinfo->sinfo_ppid = sinfo->snd_ppid; | 1145 | sndrcvinfo->sinfo_ppid = sinfo->snd_ppid; |
1159 | sndrcvinfo->sinfo_context = sinfo->snd_context; | 1146 | sndrcvinfo->sinfo_context = sinfo->snd_context; |
1160 | sndrcvinfo->sinfo_timetolive = pinfo->pr_value; | 1147 | sndrcvinfo->sinfo_timetolive = pinfo->pr_value; |
@@ -1237,12 +1224,7 @@ dgram_sctp_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
1237 | sockopt_len = sizeof(struct sctp_authkey) + 64 * sizeof(uint8_t); | 1224 | sockopt_len = sizeof(struct sctp_authkey) + 64 * sizeof(uint8_t); |
1238 | authkey = calloc(1, sockopt_len); | 1225 | authkey = calloc(1, sockopt_len); |
1239 | authkey->sca_keynumber = authkeyid.scact_keynumber + 1; | 1226 | authkey->sca_keynumber = authkeyid.scact_keynumber + 1; |
1240 | #ifndef __FreeBSD__ | ||
1241 | /* This field is missing in FreeBSD 8.2 and earlier, | ||
1242 | * and FreeBSD 8.3 and higher work without it. | ||
1243 | */ | ||
1244 | authkey->sca_keylength = 64; | 1227 | authkey->sca_keylength = 64; |
1245 | #endif | ||
1246 | memcpy(&authkey->sca_key[0], ptr, 64 * sizeof(uint8_t)); | 1228 | memcpy(&authkey->sca_key[0], ptr, 64 * sizeof(uint8_t)); |
1247 | 1229 | ||
1248 | ret = setsockopt(b->num, IPPROTO_SCTP, SCTP_AUTH_KEY, authkey, sockopt_len); | 1230 | ret = setsockopt(b->num, IPPROTO_SCTP, SCTP_AUTH_KEY, authkey, sockopt_len); |