Changeset 2191 for trunk


Ignore:
Timestamp:
Jul 3, 2005, 9:01:54 AM (20 years ago)
Author:
bird
Message:

Ported crypt from GLIBC 2.3.x CVS.

Location:
trunk/src/emx
Files:
1 added
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/src/lib/lgpl/crypt/crypt-entry.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2190 r2191  
    2525 */
    2626
     27#include "libc-alias-glibc.h"
    2728#ifdef DEBUG
    2829#include <stdio.h>
     
    4849/* Prototypes for local functions.  */
    4950#if __STDC__ - 0
    50 #ifndef __GNU_LIBRARY__
     51#if !defined __GNU_LIBRARY__ && !defined __INNOTEK_LIBC__
    5152void _ufc_clearmem (char *start, int cnt);
    5253#else
     
    8081  ufc_long xx = 25; /* to cope with GCC long long compiler bugs */
    8182
    82 #ifdef _LIBC
     83#if defined _LIBC || defined __INNOTEK_LIBC__
    8384  /* Try to find out whether we have to use MD5 encryption replacement.  */
    8485  if (strncmp (md5_salt_prefix, salt, sizeof (md5_salt_prefix) - 1) == 0)
     
    119120
    120121char *
    121 crypt (key, salt)
     122_STD(crypt) (key, salt)
    122123     const char *key;
    123124     const char *salt;
    124125{
    125 #ifdef _LIBC
     126#if defined _LIBC || defined __INNOTEK_LIBC__
    126127  /* Try to find out whether we have to use MD5 encryption replacement.  */
    127128  if (strncmp (md5_salt_prefix, salt, sizeof (md5_salt_prefix) - 1) == 0)
     
    137138 * They don't need to call init_des.
    138139 */
    139 #ifdef _LIBC
     140#if defined _LIBC || defined __INNOTEK_LIBC__
    140141weak_alias (crypt, fcrypt)
    141142#else
  • trunk/src/emx/src/lib/lgpl/crypt/crypt.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2190 r2191  
    2525 */
    2626
     27#include "libc-alias-glibc.h"
    2728#include "ufc-crypt.h"
    2829#include "crypt.h"
  • trunk/src/emx/src/lib/lgpl/crypt/crypt_util.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2190 r2191  
    2525 */
    2626
     27#include "libc-alias-glibc.h"
    2728#ifdef DEBUG
    2829#include <stdio.h>
     
    4950/* Prototypes for local functions.  */
    5051#if __STDC__ - 0
    51 #ifndef __GNU_LIBRARY__
     52#if !defined(__GNU_LIBRARY__) && !defined(__INNOTEK_LIBC__)
    5253void _ufc_clearmem (char *start, int cnt);
    5354void _ufc_copymem (char *from, char *to, int cnt);
     
    260261 * (crypt/encrypt/setkey)
    261262 */
    262 struct crypt_data _ufc_foobar;
     263struct crypt_data _ufc_foobar = {{0}};
    263264
    264265#ifdef __GNU_LIBRARY__
     
    267268__libc_lock_define_initialized (static, _ufc_tables_lock)
    268269#endif
    269 
    270 #ifdef DEBUG
     270#ifdef __INNOTEK_LIBC__
     271#include <sys/smutex.h>
     272#endif
     273
     274
     275
     276#if defined(DEBUG) && !defined(__INNOTEK_LIBC__)
    271277
    272278void
     
    303309#endif
    304310
    305 #ifndef __GNU_LIBRARY__
     311#if !defined(__GNU_LIBRARY__) && !defined(__INNOTEK_LIBC__)
    306312/*
    307313 * Silly rewrites of 'bzero'/'memset'. I do so
     
    369375      goto small_tables_done;
    370376#endif
     377#ifdef __INNOTEK_LIBC__
     378    static _smutex smtx;
     379    _smutex_request(&smtx);
     380    if(small_tables_initialized)
     381      goto small_tables_done;
     382#endif
     383
     384
    371385
    372386    /*
     
    474488    __libc_lock_unlock(_ufc_tables_lock);
    475489#endif
     490#ifdef __INNOTEK_LIBC__
     491small_tables_done:
     492    _smutex_release(&smtx);
     493#endif
    476494  }
    477495
     
    874892
    875893void
    876 encrypt(__block, __edflag)
     894_STD(encrypt)(__block, __edflag)
    877895     char *__block;
    878896     int __edflag;
     
    908926
    909927void
    910 setkey(__key)
     928_STD(setkey)(__key)
    911929     __const char *__key;
    912930{
  • trunk/src/emx/src/lib/lgpl/crypt/md5-crypt.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2190 r2191  
    2121   02111-1307 USA.  */
    2222
     23#include "libc-alias-glibc.h"
    2324#include <assert.h>
    2425#include <errno.h>
     
    214215  if (buflen <= 0)
    215216    {
    216       __set_errno (ERANGE);
     217      errno = ERANGE;
    217218      buffer = NULL;
    218219    }
     
    263264}
    264265
    265 #ifndef _LIBC
     266#if !defined _LIBC && !defined __INNOTEK_LIBC__
    266267static void
    267268__attribute__ ((__destructor__))
  • trunk/src/emx/src/lib/lgpl/crypt/md5.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2190 r2191  
    2222/* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.  */
    2323
     24#include "libc-alias-glibc.h"
    2425#ifdef HAVE_CONFIG_H
    2526# include <config.h>
     
    2829#include <sys/types.h>
    2930
    30 #if STDC_HEADERS || defined _LIBC
     31#if STDC_HEADERS || defined _LIBC || defined __INNOTEK_LIBC__
    3132# include <stdlib.h>
    3233# include <string.h>
     
    3940#include "md5.h"
    4041
    41 #ifdef _LIBC
     42#if defined _LIBC || defined __INNOTEK_LIBC__
    4243# include <endian.h>
    4344# if __BYTE_ORDER == __BIG_ENDIAN
     
    246247  if (len >= 64)
    247248    {
    248 #if !_STRING_ARCH_unaligned
     249#if defined _STRING_ARCH_unaligned && !_STRING_ARCH_unaligned
    249250/* To check alignment gcc has an appropriate operator.  Other
    250251   compilers don't.  */
  • trunk/src/emx/src/lib/lgpl/crypt/md5.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r2190 r2191  
    2424#include <stdio.h>
    2525
    26 #if defined HAVE_LIMITS_H || _LIBC
     26#if defined HAVE_LIMITS_H || (defined _LIBC && _LIBC) || defined(__INNOTEK_LIBC__)
    2727# include <limits.h>
    2828#endif
     
    3535   is usually not possible.  */
    3636
    37 #ifdef _LIBC
     37#if defined _LIBC || defined __INNOTEK_LIBC__
    3838# include <stdint.h>
    3939typedef uint32_t md5_uint32;
  • trunk/src/emx/src/lib/lgpl/include/libc-alias-glibc.h

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r2190 r2191  
    4343
    4444#ifndef _LIBC_SYMBOLS_H /* hackityhack */
    45 #undef weak_alias
    46 #define weak_alias(name, aliasname)
     45# undef weak_alias
     46# ifdef __WANT_WEAK__
     47#  define weak_alias(name, aliasname) \
     48    extern __typeof(name) aliasname  __attribute__((weak, alias(#name)));
     49# else
     50#  define weak_alias(name, aliasname)
     51# endif
    4752#undef INTDEF
    4853#define INTDEF(name)
     
    566571#define __lgamma_r  _STD(lgamma_r)
    567572
    568 
    569573#endif
  • trunk/src/emx/src/lib/libc.def

    • Property cvs2svn:cvs-rev changed from 1.129 to 1.130
    r2190 r2191  
    18921892    "__std_nftw" @1892
    18931893    "___libc_FHSetFlags" @1893
     1894    "___stpncpy" @1894
     1895    ; crypt
     1896    "___crypt_r" @1895
     1897    "___encrypt_r" @1896
     1898    "___init_des" @1897
     1899    "___init_des_r" @1898
     1900    "___md5_buffer" @1899
     1901    "___md5_crypt" @1900
     1902    "___md5_crypt_r" @1901
     1903    "___md5_finish_ctx" @1902
     1904    "___md5_init_ctx" @1903
     1905    "___md5_process_block" @1904
     1906    "___md5_process_bytes" @1905
     1907    "___md5_read_ctx" @1906
     1908    "___md5_stream" @1907
     1909    "___setkey_r" @1908
     1910    "__std_crypt" @1909
     1911    "__std_encrypt" @1910
     1912    "__std_setkey" @1911
     1913    "__ufc_dofinalperm_r" @1912
     1914    "__ufc_doit_r" @1913
     1915    "__ufc_foobar" @1914
     1916    "__ufc_mk_keytab_r" @1915
     1917    "__ufc_output_conversion_r" @1916
     1918    "__ufc_setup_salt_r" @1917
Note: See TracChangeset for help on using the changeset viewer.