summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio/b_sock.c
diff options
context:
space:
mode:
authorbeck <>2000-03-19 11:13:58 +0000
committerbeck <>2000-03-19 11:13:58 +0000
commit796d609550df3a33fc11468741c5d2f6d3df4c11 (patch)
tree6c6d539061caa20372dad0ac4ddb1dfae2fbe7fe /src/lib/libcrypto/bio/b_sock.c
parent5be3114c1fd7e0dfea1e38d3abb4cbba75244419 (diff)
downloadopenbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.tar.gz
openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.tar.bz2
openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.zip
OpenSSL 0.9.5 merge
*warning* this bumps shared lib minors for libssl and libcrypto from 2.1 to 2.2 if you are using the ssl26 packages for ssh and other things to work you will need to get new ones (see ~beck/libsslsnap/<arch>) on cvs or ~beck/src-patent.tar.gz on cvs
Diffstat (limited to 'src/lib/libcrypto/bio/b_sock.c')
-rw-r--r--src/lib/libcrypto/bio/b_sock.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/lib/libcrypto/bio/b_sock.c b/src/lib/libcrypto/bio/b_sock.c
index d29b29ff8b..6409f98f57 100644
--- a/src/lib/libcrypto/bio/b_sock.c
+++ b/src/lib/libcrypto/bio/b_sock.c
@@ -163,7 +163,14 @@ int BIO_get_port(const char *str, unsigned short *port_ptr)
163 else 163 else
164 { 164 {
165 CRYPTO_w_lock(CRYPTO_LOCK_GETSERVBYNAME); 165 CRYPTO_w_lock(CRYPTO_LOCK_GETSERVBYNAME);
166 s=getservbyname(str,"tcp"); 166 /* Note: under VMS with SOCKETSHR, it seems like the first
167 * parameter is 'char *', instead of 'const char *'
168 */
169 s=getservbyname(
170#ifndef CONST_STRICT
171 (char *)
172#endif
173 str,"tcp");
167 if(s != NULL) 174 if(s != NULL)
168 *port_ptr=ntohs((unsigned short)s->s_port); 175 *port_ptr=ntohs((unsigned short)s->s_port);
169 CRYPTO_w_unlock(CRYPTO_LOCK_GETSERVBYNAME); 176 CRYPTO_w_unlock(CRYPTO_LOCK_GETSERVBYNAME);
@@ -282,12 +289,12 @@ static struct hostent *ghbn_dup(struct hostent *a)
282 289
283 j=strlen(a->h_name)+1; 290 j=strlen(a->h_name)+1;
284 if ((ret->h_name=Malloc(j)) == NULL) goto err; 291 if ((ret->h_name=Malloc(j)) == NULL) goto err;
285 memcpy((char *)ret->h_name,a->h_name,j+1); 292 memcpy((char *)ret->h_name,a->h_name,j);
286 for (i=0; a->h_aliases[i] != NULL; i++) 293 for (i=0; a->h_aliases[i] != NULL; i++)
287 { 294 {
288 j=strlen(a->h_aliases[i])+1; 295 j=strlen(a->h_aliases[i])+1;
289 if ((ret->h_aliases[i]=Malloc(j)) == NULL) goto err; 296 if ((ret->h_aliases[i]=Malloc(j)) == NULL) goto err;
290 memcpy(ret->h_aliases[i],a->h_aliases[i],j+1); 297 memcpy(ret->h_aliases[i],a->h_aliases[i],j);
291 } 298 }
292 ret->h_length=a->h_length; 299 ret->h_length=a->h_length;
293 ret->h_addrtype=a->h_addrtype; 300 ret->h_addrtype=a->h_addrtype;
@@ -327,7 +334,7 @@ static void ghbn_free(struct hostent *a)
327 Free(a->h_addr_list[i]); 334 Free(a->h_addr_list[i]);
328 Free(a->h_addr_list); 335 Free(a->h_addr_list);
329 } 336 }
330 if (a->h_name != NULL) Free((char *)a->h_name); 337 if (a->h_name != NULL) Free(a->h_name);
331 Free(a); 338 Free(a);
332 } 339 }
333 340
@@ -368,7 +375,14 @@ struct hostent *BIO_gethostbyname(const char *name)
368 if (i == GHBN_NUM) /* no hit*/ 375 if (i == GHBN_NUM) /* no hit*/
369 { 376 {
370 BIO_ghbn_miss++; 377 BIO_ghbn_miss++;
371 ret=gethostbyname(name); 378 /* Note: under VMS with SOCKETSHR, it seems like the first
379 * parameter is 'char *', instead of 'const char *'
380 */
381 ret=gethostbyname(
382#ifndef CONST_STRICT
383 (char *)
384#endif
385 name);
372 386
373 if (ret == NULL) 387 if (ret == NULL)
374 goto end; 388 goto end;