- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: can't get new crypt2() function to work
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2009 11:56 AM
тАО09-21-2009 11:56 AM
I've been reading about the new crypt2 library introduced by the PHI11i3 bundle, which enabled SHA512 password hashing. I'm trying to understand exactly what the new libraries do, but get can't get my test programs to compile. Here's what I get an 'ld: Unsatisfied symbol "crypt2"' error every time I try to compile my program. Here's what I did:
# swlist PHI11i3
# Initializing...
# Contacting target "rx16u831"...
#
# Target: rx16u831:/
#
# PHI11i3 B.11.31.02 HP-UX 11.31 Password Hashing Infrastructure
PHI11i3.SHA11i3 B.11.31.02 HP-UX 11.31 SHA11i3 Product
# cat /tmp/encrypter.c
#include
#include
main()
{
char *result;
result=crypt2("aa","user1");
printf("\nThe password hash is %s\n", result);
}
# cc -Llibsec encrypter.c -o encrypter
ld: Unsatisfied symbol "crypt2" in file encrypter.o
1 errors.
I'm guessing that I need to specify another -L, but I'm not sure what it should be.
Thanks in advance for your help.
Darren
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2009 12:09 PM
тАО09-21-2009 12:09 PM
Re: can't get new crypt2() function to work
I don't have 11.31 available nor do I have the PHI product for 11.23 installed, but at least in earlier interfaces you should have specified:
#include
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2009 12:14 PM
тАО09-21-2009 12:14 PM
Re: can't get new crypt2() function to work
I added "#include
Regards,
Darren
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2009 12:19 PM
тАО09-21-2009 12:19 PM
Re: can't get new crypt2() function to work
Try looking for a 'crypt2' header:
# find /usr/include -type f -name "crypt*"
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2009 12:28 PM
тАО09-21-2009 12:28 PM
Re: can't get new crypt2() function to work
I tried two variations on the find command, but the files found were already included in my program.
# find /usr/include -type f -name "crypt*"
/usr/include/crypt.h
# find /usr/include -type f -exec grep -l crypt2 {} \;
/usr/include/prot.h
# cat encrypter.c
#include
#include
#include
main()
{
char *result;
result=crypt2("aa","user1");
printf("\nThe password hash is %s\n", result);
}
# cc encrypter.c -o encrypter
ld: Unsatisfied symbol "crypt2" in file encrypter.o
1 errors.
Thanks again,
Darren
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2009 03:49 PM
тАО09-21-2009 03:49 PM
Re: can't get new crypt2() function to work
Good luck
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2009 06:41 PM
тАО09-21-2009 06:41 PM
Re: can't get new crypt2() function to work
Good idea. I actually did try that earlier, but no luck. The product appears to simply deliver a man page and a toggle file to enable the functionality. I wonder if the functionality was there in the original 11i v3 release but wasn't enabled because it hadn't been fully tested(?). Seems strange. The functionality does work, though. If I change a user's password, the resulting ciphertext is much longer than it was in the past.
Darren
# swlist -l file PHI11i3
# Initializing...
# Contacting target "rx16u831"...
#
# Target: rx16u831:/
#
# PHI11i3 B.11.31.02 HP-UX 11.31 Password Hashing Infrastructure
# PHI11i3.SHA11i3 B.11.31.02 HP-UX 11.31 SHA11i3 Product
# PHI11i3.SHA11i3.SHA-CONF B.11.31.02 SHA11i3 Configuration Files
PHI11i3.SHA11i3.SHA-CONF: /etc/default/ENABLE_CRYPT_ENHANCEMENT
# PHI11i3.SHA11i3.SHA-ENG-A-MAN B.11.31.02 SHA11i3 English Manpages
PHI11i3.SHA11i3.SHA-ENG-A-MAN: /usr/share/man/man3.Z/crypt2.3c
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-23-2009 06:29 AM
тАО09-23-2009 06:29 AM
Re: can't get new crypt2() function to work
Assuming the PHI11i3 bundle is correctly installed ( https://h20392.www2.hp.com/portal/swdepot/displayInstallInfo.do?productNumber=PHI11i3 )
you could try this:
1. Take a look at prot.h (and if you were so kind please attach it in next post since I have no 11i v3) to see how crypt2 is included, declared, defined.
2. Do brute force on symbol matching in libs:
find / -name '*.sl' -exec nm {} \; -print | grep -i -e crypt2 -e '^/' | more
Note the *.sl for PA-RISC (use *.so for IPF). If you're sure all your libs are only in /usr/lib and /opt:
for l in /usr/lib /opt
do
find $l -name '*.sl' -exec nm {} \; -print | grep -i -e crypt2 -e '^/'
done
If the symbol is there, it will show up...
Kind regards,
Kobylka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-23-2009 07:53 AM
тАО09-23-2009 07:53 AM
Re: can't get new crypt2() function to work
THanks so much for looking at my issue! I ran the for loop as you suggested and got a long list of several hundred file paths. I think these might be the pertinent lines:
/usr/lib/hpux32/librwtool_v2.so
[418] | 67351168| 640|FUNC |GLOB |0| .text|crypt2
[356] | 67351840| 400|FUNC |GLOB |0| .text|crypt2_passwd_hash
[543] | 67353600| 304|FUNC |GLOB |0| .text|crypt2_passwd_match
[431] | 67352256| 1344|FUNC |GLOB |0| .text|crypt2_passwd_salt
/usr/lib/hpux64/libprocsm.so
[418] | 4611686018427643296| 656|FUNC |GLOB |0| .text|crypt2
[356] | 4611686018427644000| 400|FUNC |GLOB |0| .text|crypt2_passwd_h
ash
[543] | 4611686018427645824| 336|FUNC |GLOB |0| .text|crypt2_passwd_m
atch
[431] | 4611686018427644416| 1408|FUNC |GLOB |0| .text|crypt2_passwd_s
alt
I tried re-compiling with those libraries specifically included, though, and still got ld errors:
# cc -v -L/usr/lib/hpux32/librwtool_v2.so -L/usr/lib/hpux64/libprocsm.so /tmp/encrypter.c -o /tmp/encrypter
/usr/ccs/lbin/ecom -architecture 32 -ia64abi all -ext on -lang c -exception off -sysdir /usr/include -inline_power 0 -link_type dynamic -fpeval float -tls_dyn on -target_os 11.31 --sys_include /usr/include -D__hpux -D__unix -D__ia64=1 -D_BIG_ENDIAN=1 -D_ILP32 -D__unordered= -D__synchronous= -D__non_sequential= -D__side_effect_free= -D__HP_cc=61200 -D__STDC_EXT__ -D_HPUX_SOURCE -D_INCLUDE_LONGLONG -D_INLINE_ASM -D_BIND_LIBCALLS -D_Math_errhandling=MATH_ERREXCEPT -D_FLT_EVAL_METHOD=0 -ucode hdriver=optlevel%1%:inline=inl_level%0% -plusolistoption -Ol06const! -plusolistoption -Ol13moderate! -plusooption -Oq01,al,ag,cn,sz,ic,vo,Mf,Po,es,rs,Rf,Pr,sp,in,cl,om,vc,pi,fa,pe,rr,pa,pv,nf,cp,lx,Pg,ug,lu,lb,uj,dn,sg,pt,kt,em,np,ar,rp,dl,fs,bp,wp,pc,mp,lr,cx,cr,pi,so,Rc,fa,ft,fe,ap,st,lc,Bl,sr,ib,pl,sd,ll,rl,dl,Lt,ol,fl,lm,ts,rd,dp,If! /tmp/encrypter.c
"/tmp/encrypter.c", line 16: warning #2513-D: a value of type "int" cannot be
assigned to an entity of type "char *"
salt = crypt_2passwd_salt(oldhash, username);
^
LPATH=/usr/lib/hpux32:/opt/langtools/lib/hpux32:/usr/lib/hpux64:/opt/langtools/lib/hpux64
/usr/ccs/bin/ld -o /tmp/encrypter -u___exit -umain -L /usr/lib/hpux32/librwtool_v2.so -L /usr/lib/hpux64/libprocsm.so encrypter.o -lc
ld: Unsatisfied symbol "crypt2" in file encrypter.o
ld: Unsatisfied symbol "crypt_2passwd_salt" in file encrypter.o
2 errors.
removing /var/tmp/AAA026567
Per your request, I've attached the prot.h file from my system. You probably already discovered this, but the man page is available on the web at http://docs.hp.com/en/B3921-60631/crypt2.3C.html.
Thanks again for taking a look.
Darren
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-23-2009 07:55 AM
тАО09-23-2009 07:55 AM
Re: can't get new crypt2() function to work
Darren