귀찮귀찮

GT-P1000 (GSM)
GT-P1010 (Wi-Fi Model)
SHW-M180W (Wi-Fi Model, Korea only)
SHW-M180S (SKT)
SHW-M180K (KTF)
SHW-M180L (LGU+)
SCH-I800 (Verizon, US Cellular)
SPH-P100 (Sprint)
SGH-I987 (AT&T)
SGH-T849 (T-Mobile)
SC-01C (NTT DoCoMo)
Posted by 배트
,
1. 꼴에 Enterprise는 잘 안깔린다. Professional이 잘 깔리는 듯.
2. 되도록 가상 드라이브는 사용하지 말고, ISO를 임시경로에 풀어서 설치하자.
3. Setup.exe를 이용해서 설치하려면 SETUPSIZ.INI에서 vmpath를 Oracle의 java.exe로 바꿔주자.
4. 구성요소 선택할 때 OLE object viewer를 제거하고 설치하자.
5. 아래 커맨드가 가장 무난히 설치된다.

D:\vs6pro\SETUP\acmsetup.exe /t VS98PRO.STF /s D:\vs6pro /n "NAME /o "COMPANY" /k "0000000000"


Posted by 배트
,
This information must be used for review purpose.

11. Rights Issuer Certification

As a prerequisite for issuing a Rights Issuer certificate for the Service Provider, it is assumed that the Service Provider has already generated a Rights Issuer RSA key pair in an environment that satisfies the security requirements stipulated by the Rights Issuer Robustness Rules, another prerequisite is for the Service Provider to have fulfilled the Exhibit G of the Service Provider Agreement and to have communicated it to CMLA.. After that has been done, the first time certification and subsequent re-certifications are done as defined below.

 

1.        Service Provider creates self-signed DER encoded PKCS#10 certificate request [PKCS#10], burns a DVD-R containing the request, and sends the DVD-R to CMLA. This request SHALL be signed using sha-1WithRSAEncryption as defined in [RFC3279].
The file naming convention is
Rights_Issuer_*_##.p10, where * is replaced with the Service Providers name and ## is replaced with a two digit number.  The Service Provider also submits the Rights Issuer Certificate ordering form to CMLA via signed email and the original via regular courier.  .  This ordering form will include the SHA1 hash of the public key (PKCS#1 RSAPublicKey structure in the subjectPublicKey field) inside the PKCS#10 request PKCS#10 file (20 bytes, encoded in hexadecimal).

2.        CMLA will review and verify each request submitted. After verification, CMLA generates an invoice.

3.        The Invoice is sent via email and hard copy to the Service Provider.

4.        Service Provider makes payment on invoice.

5.        Upon receipt of payment on invoice, CMLA processes order and responds.  Order processing includes the verification of the hash value provided in the Rights Issuer Certificate ordering form to the hash value calculated over the to be certified public key. If none of the verifications fail CMLA creates, according to the certificate request, a Rights Issuer Certificate and delivers it with the corresponding Rights Issuer CA Certificate to the Service Provider in a DVD-R.
The file naming convention for the Rights Issuer Certificate is
Rights_Issuer_*_##.der, where * is replaced with the Service Providers name and ## is replaced with the two digit number. The file contains the DER encoding of the Rights Issuer Certificate 
The file naming convention for the Rights Issuer CA Certificate is
Rights_Issuer_CA_Certs.der. The file contains the DER encoding of the Rights Issuer CA Certificate.

6.        CMLA registers into certificate database necessary information such as the certificate issued by the RI CA, request data, and certificate delivery data.

 

CMLA Root CA Certificates are delivered to Service Providers in the same way as to the Client Adopters (check chapter 10.1 step 2 for details).


출처: CMLA Technical Specification V1.31-20101209
아 이거 퍼오는거 불법같은데 하도 답답해서 ㅠ
Posted by 배트
,
오랜만에 자바하니까 귀찮긔...

public String getHTTPDocuement(String urlString, String [] postParameterNames, String [] postParameterValues) {
        String resultDocument = "";

        try {
            URL url = new URL(urlString);
            HttpURLConnection http = null;
           
            HttpURLConnection.setFollowRedirects(false);
           
            // Redirects HTTP documents at most 5 times
            int numRedirects = 0;
            while( true ) {
                // Opens the URL
                http = (HttpURLConnection)url.openConnection();

                // Sets the parameters
                // This logic should be only executed at first time
                if(numRedirects==0 && postParameterNames!=null && postParameterValues!=null) {
                    String postParameterData = "";

                    http.setDoOutput(true);
                    http.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
                    http.setRequestMethod("POST"); // can be skipped

                    for (int j = 0; j < postParameterNames.length; j++) {
                        postParameterData += postParameterNames[j] + "=" + URLEncoder.encode(postParameterValues[j]) + "&";
                    }

                    OutputStream outputStream = http.getOutputStream();

                    outputStream.write( postParameterData.getBytes("UTF-8") );
                    outputStream.flush();
                    outputStream.close();
                }

                // Checks whether the HTTP document want to redirect
                int responseCode = http.getResponseCode();
                if (responseCode >= 300 && responseCode <= 307 && responseCode != 306 && responseCode != HttpURLConnection.HTTP_NOT_MODIFIED ) {
                    URL base = http.getURL();
                    String loc = http.getHeaderField("Location");
                    if (loc != null)
                    {
                        url = new URL(base, loc);
                    }
                    http.disconnect();
                    if (url == null
                            // Allows a redirection from unsecure protocol to secure protocol or vice versa
                            //|| !(target.getProtocol().equals("http")
                            //|| target.getProtocol().equals("https"))
                            || numRedirects >= 5)
                    {
                        throw new SecurityException("illegal URL redirect");
                    }
                    numRedirects++;
                    continue;
                }
               
                // No more redirections
                break;
            }

            // Gets the HTTP response
            BufferedReader inputBufferReader = new BufferedReader(new InputStreamReader(http.getInputStream()));
            StringBuffer buffer = new StringBuffer();

            int c;
            while((c=inputBufferReader.read()) != -1){
                buffer.append((char)c);
            }

            resultDocument = buffer.toString().trim();

        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

        return resultDocument;
    }
Posted by 배트
,
MinGW를 사용해 openssl 0.9.8r을 빌드하려고 했는데,
Win32의 include 경로가 제대로 잡히지 않는지 make 단계에서 에러가 발생한다.

결국 기존의 방식대로 ActivePerl과 MS C Compiler를 사용해 빌드하기로 했다.

OpenSSL의 Config은 Perl 스크립트로 되어있고,
MS-WIN32라는 환경 프리셋을 제공하므로,
Perl만 사용할 수 있으면 Win32에서 빌드할 수 있다.
(Perl에는 지식이 없지만, 아마 이런 스크립트들은 모두 Perl로 되어있으리라 추정한다.)

1. MS Visual Studio가 설치되어 있어야 한다.

2. ActivePerl을 다운받고 설치한다.
   http://www.activestate.com/
   다른 Perl 도구가 있으면 사용해도 되겠다.

3. OpenSSL의 소스를 다운받고 적당한 곳에 압축을 푼다. (여기에선 C:\W32Build 아래에)

4. 커맨드 프롬프트 창을 연다.

5. MS Visual Studio 개발 환경의 환경변수가 모두 지정되어 있지 않다면,
   아래와 같은 배치명령어로 환경변수를 등록한다.
   VC6 : C:\Program Files\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT
   VC9 : C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat

6. OpenSSL의 소스가 있는 곳으로 가서 Configure를 실행한다.
   C:\W32Build\openssl-0.9.8k>perl Configure VC-WIN32 --openssldir=C:\OpenSSL
   Configure는 순식간에 끝난다.

7. 성능을 높이기 위해 MS assembler(MASM)을 사용하려면,
    아래 사이트에서 MASM32 SDK를 다운받고 설치한다.
    http://www.masm32.com/

8. 이제 Make 파일을 만든다.
   어셈블러 코드를 포함한 Make 파일을 만드려면
       C:\W32Build\openssl-0.9.8k>ms\do_ms.bat
   모두 C 코드로 빌드하는 Make 파일을 만드려면
       C:\W32Build\openssl-0.9.8k>ms\do_msam.bat
   을 실행한다.
   그러면 ms\nt.mak와 ms\ntdll.mak가 생성된다.

9. nt.mak는 OpenSSL 프로그램을 빌드하고, ntdll.mak는 OpenSSL의 DLL을 빌드한다.
   DLL을 빌드하려면,
      nmake -f ms\ntdll.mak
   을 실행하면 된다.
   빌드된 파일들은 out32dll 폴더와 설정시 입력했던 C:\OpenSSL 폴더 아래에 있다.

Good luck!

출처: http://www.lovelgw.com/Blog/61
Posted by 배트
,
Windows/C++ 용 HTTP 라이브러리는 그냥 이게 갑인 듯.
http://www.codeproject.com/KB/IP/w3client.aspx
Posted by 배트
,
Checking a platform

#ifdef _WIN32 // note the underscore: without it, it's not msdn official!

    // Windows (x64 and x86)

#elif __unix__ // all unices

    // Unix

#elif __posix__

    // POSIX

#elif linux

    // linux

#elif __APPLE__

    // Mac OS, not sure if this is covered by __posix__ and/or __unix__ though...

#endif

//__MINGW32__
//__GNUC__ 
// _AIX32, _AIX41, _AIX43, __HOS_AIX__ (_AIX32 (the OS version >= 3.2) maybe useful)
//  

ex)
when a binary is complied by GCC 4.4.5 on Ubuntu 10.10
__unix__, linux, __GNUC__ are defined. 



Macros for Visual C
 (+ANSI macros)
Macros for gcc

http://docs.wxwidgets.org/stable/wx_cppconst.html

UI system
__WINDOWS__ any Windows, yom may also use __WXMSW__
__WIN16__ Win16 API (not supported since wxWidgets 2.6)
__WIN32__ Win32 API
__WXBASE__ Only wxBase, no GUI features (same as wxUSE_GUI == 0)
__WXCOCOA__ OS X using Cocoa API
__WXWINCE__ Windows CE
__WXGTK__ GTK+
__WXGTK12__ GTK+ 1.2 or higher
__WXGTK20__ GTK+ 2.0 or higher
__WXMOTIF__ Motif
__WXMOTIF20__ Motif 2.0 or higher
__WXMAC__ Mac OS all targets
__WXMAC_CLASSIC__ MacOS for Classic
__WXMAC_CARBON__ MacOS for Carbon CFM (running under Classic or OSX) or true OS X Mach-O Builds
__WXMAC_OSX__ MacOS X Carbon Mach-O Builds
__WXMGL__ SciTech Soft MGL (__WXUNIVERSAL__ will be also defined)
__WXMSW__ Any Windows
__WXOSX__ Any Mac OS X port (either Carbon or Cocoa)
__WXPALMOS__ PalmOS
__WXPM__ OS/2 native Presentation Manager
__WXSTUBS__ Stubbed version ('template' wxWin implementation)
__WXXT__ Xt; mutually exclusive with WX_MOTIF, not implemented in wxWidgets 2.x
__WXX11__ wxX11 (__WXUNIVERSAL__ will be also defined)
__WXWINE__ WINE (i.e. WIN32 on Unix)
__WXUNIVERSAL__ wxUniversal port, always defined in addition to one of the symbols above so this should be tested first.
__X__ any X11-based GUI toolkit except GTK+ 

Operating systems
__APPLE__ any Mac OS version
__AIX__ AIX
__BSD__ Any *BSD system
__CYGWIN__ Cygwin: Unix on Win32
__DARWIN__ Mac OS X using the BSD Unix C library (as opposed to using the Metrowerks MSL C/C++ library)
__DATA_GENERAL__ DG-UX
__DOS_GENERAL__ DOS (used with wxMGL only)
__FREEBSD__ FreeBSD
__HPUX__ HP-UX (Unix)
__GNU__ GNU Hurd
__LINUX__ Linux
__MACH__ Mach-O Architecture (Mac OS X only builds)
__OSF__ OSF/1
__PALMOS__ PalmOS
__SGI__ IRIX
__SOLARIS__ Solaris
__SUN__ Any Sun
__SUNOS__ Sun OS
__SVR4__ SystemV R4
__SYSV__ SystemV generic
__ULTRIX__ Ultrix
__UNIX__ any Unix
__UNIX_LIKE__ Unix, BeOS or VMS
__VMS__ VMS
__WINDOWS__ any Windows
__WINE__ Wine

Compilers
__BORLANDC__ Borland C++. The value of the macro corresponds to the compiler version: 500 is 5.0.
__DJGPP__ DJGPP
__DIGITALMARS__ Digital Mars
__GNUG__ Gnu C++ on any platform, see also wxCHECK_GCC_VERSION
__GNUWIN32__ Gnu-Win32 compiler, see also wxCHECK_W32API_VERSION
__MINGW32__ MinGW
__MWERKS__ CodeWarrior MetroWerks compiler
__SUNCC__ Sun CC
__SYMANTECC__ Symantec C++
__VISAGECPP__ IBM Visual Age (OS/2)
__VISUALC__ Microsoft Visual C++. The value of this macro corresponds to the compiler version: 1020 for 4.2 (the first supported version), 1100 for 5.0, 1200 for 6.0 and so on
__XLC__ AIX compiler
__WATCOMC__ Watcom C++. The value of this macro corresponds to the compiler version, 1100 is 11.0 and 1200 is OpenWatcom.
_WIN32_WCE Windows CE version
 
Posted by 배트
,
아. 왜 이렇게 간단한 걸 진작에 생각 못했지.

const static short s_sh = 0x00ff;
const static char *s_pch = (char*)&s_sh;

#define IsOrderingBigEndian (s_pch[0]==0?TRUE:FALSE)



Simpler: 

const static short s_sh = 0x0100;
const static char *s_pch = (char*)&s_sh;

#define IsOrderingBigEndian (s_pch[0])

 
Posted by 배트
,
1. 커널 소스를 써야 한다. (최소한 드라이버 모듈)
2. 아래와 같이 File operation만 치환하려고 했는데,
    i_fop가 const로 정의되어 있어서 (linux/fs.h ln642) 에러만 난다.
    code) filp->f_dentry->d_inode->i_fop->llseek = my_llseek;
3. 결국 Block device driver 형태로 만드는 수 밖에 없는데,
    시간을 더 쓸 수가 없어서 이쯤에서 pending. 다음 기회에.
Posted by 배트
,
// function for adding two big number in big endian
static void add(const unsigned char *a, int la, const unsigned char *b, int lb, unsigned char *mul, int *lmul)
{
int ltemp = ((la>lb)?la:lb)+1;
int lmin = ((la>lb)?lb:la);
unsigned char *temp = (unsigned char*)malloc(ltemp);
int xa = la-1, xb = lb-1, y = ltemp-1, u = 0;
int k = 0, z = 0;

memset(temp, 0, ltemp);

while(xa>=0 && xb>=0)
{
temp[y] = a[xa] + b[xb] + u;

if( temp[y] < a[xa] )
u = 1;
else
u = 0;

y--;
xa--;
xb--;
}

while(temp[++k]==0);

for(z=k ; z<ltemp ; z++)
mul[z-k] = temp[z];
*lmul = z-k;

free(temp); 
}
Posted by 배트
,